diff --git a/Dockerfile b/Dockerfile index 6c0b3e624d..c3341a83e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ RUN apt-get update \ flex \ gcc \ jq \ - libboost-all-dev \ libboost-test-dev \ libcrypto++-dev \ libffi-dev \ @@ -19,7 +18,6 @@ RUN apt-get update \ libjemalloc-dev \ libmpfr-dev \ libprocps-dev \ - libprotobuf-dev \ libsecp256k1-dev \ libssl-dev \ libtool \ @@ -32,7 +30,6 @@ RUN apt-get update \ openjdk-11-jdk \ pandoc \ pkg-config \ - protobuf-compiler \ python3 \ python-pygments \ python-recommonmark \ diff --git a/Jenkinsfile b/Jenkinsfile index a96a5ee131..5e37633015 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,26 +8,14 @@ pipeline { PACKAGE = 'kevm' ROOT_URL = 'https://github.com/kframework/evm-semantics/releases/download' } - options { - ansiColor('xterm') - } + options { ansiColor('xterm') } stages { stage("Init title") { - when { - changeRequest() - beforeAgent true - } - steps { - script { - currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}" - } - } + when { changeRequest() } + steps { script { currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}" } } } stage('Build and Test') { - when { - changeRequest() - beforeAgent true - } + when { changeRequest() } agent { dockerfile { additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)' @@ -36,56 +24,15 @@ pipeline { } } stages { - stage('Dependencies') { - parallel { - stage('K') { - steps { - sh ''' - make deps RELEASE=true - ''' - } - } - stage('Tests') { - steps { - sh ''' - make split-tests -j3 - ''' - } - } - } - } - stage('Build') { - steps { - sh ''' - make build -j4 - ''' - } - } + stage('K Dependencies') { steps { sh 'make deps RELEASE=true' } } + stage('Build') { steps { sh 'make build RELEASE=true -j6' } } stage('Test Execution') { failFast true options { timeout(time: 20, unit: 'MINUTES') } parallel { - stage('Conformance (LLVM)') { - steps { - sh ''' - make test-conformance -j8 TEST_CONCRETE_BACKEND=llvm - ''' - } - } - stage('VM (Haskell)') { - steps { - sh ''' - make test-vm -j8 TEST_CONCRETE_BACKEND=haskell - ''' - } - } - stage('Conformance (Web3)') { - steps { - sh ''' - make test-web3 -j8 - ''' - } - } + stage('Conformance (LLVM)') { steps { sh 'make test-conformance -j8 TEST_CONCRETE_BACKEND=llvm' } } + stage('VM (Haskell)') { steps { sh 'make test-vm -j8 TEST_CONCRETE_BACKEND=haskell' } } + stage('Conformance (Web3)') { steps { sh 'make test-web3 -j8' } } } } stage('Proofs') { @@ -94,79 +41,70 @@ pipeline { timeout(time: 55, unit: 'MINUTES') } parallel { - stage('Java + Haskell') { - steps { - sh ''' - make test-prove -j6 - ''' - } - } - stage('Haskell (dry-run)') { - steps { - sh ''' - make test-prove -j2 KPROVE_OPTIONS='--dry-run' TEST_SYMBOLIC_BACKEND='haskell' - ''' - } - } + stage('Java + Haskell') { steps { sh 'make test-prove -j6' } } + stage('Haskell (dry-run)') { steps { sh 'make test-prove -j2 KPROVE_OPTIONS=--dry-run TEST_SYMBOLIC_BACKEND=haskell' } } } } stage('Test Interactive') { failFast true options { timeout(time: 35, unit: 'MINUTES') } parallel { - stage('LLVM krun') { - steps { - sh ''' - make test-interactive-run TEST_CONCRETE_BACKEND=llvm - ''' - } - } - stage('Java krun') { - steps { - sh ''' - make test-interactive-run TEST_CONCRETE_BACKEND=java - ''' - } - } - stage('Haskell krun') { - steps { - sh ''' - make test-interactive-run TEST_CONCRETE_BACKEND=haskell - ''' - } - } - stage('LLVM Kast') { - steps { - sh ''' - make test-parse TEST_CONCRETE_BACKEND=llvm - ''' - } - } - stage('Failing tests') { - steps { - sh ''' - make test-failure TEST_CONCRETE_BACKEND=llvm - ''' - } - } - stage('Java KLab') { - steps { - sh ''' - make test-klab-prove TEST_SYMBOLIC_BACKEND=java - ''' - } - } - stage('Haskell Search') { - steps { - sh ''' - make test-interactive-search TEST_SYMBOLIC_BACKEND=haskell -j4 - ''' - } - } - stage('KEVM help') { - steps { + stage('LLVM krun') { steps { sh 'make test-interactive-run TEST_CONCRETE_BACKEND=llvm' } } + stage('Java krun') { steps { sh 'make test-interactive-run TEST_CONCRETE_BACKEND=java' } } + stage('Haskell krun') { steps { sh 'make test-interactive-run TEST_CONCRETE_BACKEND=haskell' } } + stage('LLVM Kast') { steps { sh 'make test-parse TEST_CONCRETE_BACKEND=llvm' } } + stage('Failing tests') { steps { sh 'make test-failure TEST_CONCRETE_BACKEND=llvm' } } + stage('Java KLab') { steps { sh 'make test-klab-prove TEST_SYMBOLIC_BACKEND=java' } } + stage('Haskell Search') { steps { sh 'make test-interactive-search TEST_SYMBOLIC_BACKEND=haskell -j4' } } + stage('KEVM help') { steps { sh './kevm help' } } + } + } + } + } + stage('Deploy') { + when { branch 'master' } + agent { dockerfile { reuseNode true } } + stages { + stage('Update Dependents') { + steps { + build job: 'rv-devops/master', propagate: false, wait: false \ + , parameters: [ booleanParam(name: 'UPDATE_DEPS_SUBMODULE', value: true) \ + , string(name: 'PR_REVIEWER', value: 'ehildenb') \ + , string(name: 'UPDATE_DEPS_REPOSITORY', value: 'runtimeverification/firefly') \ + , string(name: 'UPDATE_DEPS_SUBMODULE_DIR', value: 'deps/evm-semantics') \ + ] + build job: 'rv-devops/master', propagate: false, wait: false \ + , parameters: [ booleanParam(name: 'UPDATE_DEPS_SUBMODULE', value: true) \ + , string(name: 'PR_REVIEWER', value: 'ehildenb') \ + , string(name: 'UPDATE_DEPS_REPOSITORY', value: 'runtimeverification/erc20-verification') \ + , string(name: 'UPDATE_DEPS_SUBMODULE_DIR', value: 'deps/evm-semantics') \ + ] + } + } + stage('Jello Paper') { + steps { + sshagent(['2b3d8d6b-0855-4b59-864a-6b3ddf9c9d1a']) { + dir("kevm-${env.VERSION}-jello-paper") { sh ''' - ./kevm help + git config --global user.email "admin@runtimeverification.com" + git config --global user.name "RV Jenkins" + mkdir -p ~/.ssh + echo 'host github.com' > ~/.ssh/config + echo ' hostname github.com' >> ~/.ssh/config + echo ' user git' >> ~/.ssh/config + echo ' identityagent SSH_AUTH_SOCK' >> ~/.ssh/config + echo ' stricthostkeychecking accept-new' >> ~/.ssh/config + chmod go-rwx -R ~/.ssh + ssh github.com || true + git clone 'ssh://github.com/kframework/evm-semantics.git' + cd evm-semantics + git checkout -B gh-pages origin/master + rm -rf .build .gitignore .gitmodules cmake deps Dockerfile Jenkinsfile kast-json.py kevm kore-json.py LICENSE Makefile media package + git add ./ + git commit -m 'gh-pages: remove unrelated content' + git fetch origin gh-pages + git merge --strategy ours FETCH_HEAD + git push origin gh-pages ''' } } @@ -174,22 +112,5 @@ pipeline { } } } - stage('Update Dependents') { - when { branch 'master' } - steps { - build job: 'rv-devops/master', propagate: false, wait: false \ - , parameters: [ booleanParam(name: 'UPDATE_DEPS_SUBMODULE', value: true) \ - , string(name: 'PR_REVIEWER', value: 'ehildenb') \ - , string(name: 'UPDATE_DEPS_REPOSITORY', value: 'runtimeverification/firefly') \ - , string(name: 'UPDATE_DEPS_SUBMODULE_DIR', value: 'deps/evm-semantics') \ - ] - build job: 'rv-devops/master', propagate: false, wait: false \ - , parameters: [ booleanParam(name: 'UPDATE_DEPS_SUBMODULE', value: true) \ - , string(name: 'PR_REVIEWER', value: 'ehildenb') \ - , string(name: 'UPDATE_DEPS_REPOSITORY', value: 'runtimeverification/erc20-verification') \ - , string(name: 'UPDATE_DEPS_SUBMODULE_DIR', value: 'deps/evm-semantics') \ - ] - } - } } } diff --git a/Makefile b/Makefile index c7bdb85887..ffd88c0f29 100644 --- a/Makefile +++ b/Makefile @@ -1,38 +1,37 @@ # Settings # -------- +DEPS_DIR := deps BUILD_DIR := .build SUBDEFN_DIR := . DEFN_BASE_DIR := $(BUILD_DIR)/defn DEFN_DIR := $(DEFN_BASE_DIR)/$(SUBDEFN_DIR) BUILD_LOCAL := $(abspath $(BUILD_DIR)/local) +LOCAL_LIB := $(BUILD_LOCAL)/lib -LIBRARY_PATH := $(BUILD_LOCAL)/lib +K_SUBMODULE := $(DEPS_DIR)/k +ifneq (,$(wildcard $(K_SUBMODULE)/k-distribution/target/release/k/bin/*)) + K_RELEASE ?= $(abspath $(K_SUBMODULE)/k-distribution/target/release/k) +else + K_RELEASE ?= $(dir $(shell which kompile)).. +endif +K_BIN := $(K_RELEASE)/bin +K_LIB := $(K_RELEASE)/lib/kframework +export K_RELEASE + +LIBRARY_PATH := $(LOCAL_LIB) C_INCLUDE_PATH += :$(BUILD_LOCAL)/include CPLUS_INCLUDE_PATH += :$(BUILD_LOCAL)/include -PKG_CONFIG_PATH := $(LIBRARY_PATH)/pkgconfig +PATH := $(K_BIN):$(PATH) export LIBRARY_PATH export C_INCLUDE_PATH export CPLUS_INCLUDE_PATH -export PKG_CONFIG_PATH - -INSTALL_PREFIX := /usr/local -INSTALL_DIR ?= $(DESTDIR)$(INSTALL_PREFIX)/bin +export PATH -DEPS_DIR := deps -K_SUBMODULE := $(abspath $(DEPS_DIR)/k) PLUGIN_SUBMODULE := $(abspath $(DEPS_DIR)/plugin) export PLUGIN_SUBMODULE -K_RELEASE ?= $(K_SUBMODULE)/k-distribution/target/release/k -K_BIN := $(K_RELEASE)/bin -K_LIB := $(K_RELEASE)/lib -export K_RELEASE - -PATH := $(K_BIN):$(PATH) -export PATH - # need relative path for `pandoc` on MacOS PANDOC_TANGLE_SUBMODULE := $(DEPS_DIR)/pandoc-tangle TANGLER := $(PANDOC_TANGLE_SUBMODULE)/tangle.lua @@ -42,21 +41,20 @@ export LUA_PATH .PHONY: all clean distclean \ deps all-deps llvm-deps haskell-deps repo-deps k-deps plugin-deps libsecp256k1 libff \ - build build-java build-node build-haskell build-llvm build-web3 \ - defn java-defn node-defn web3-defn haskell-defn llvm-defn \ - split-tests \ + build build-java build-specs build-haskell build-llvm build-web3 \ + defn java-defn specs-defn web3-defn haskell-defn llvm-defn \ test test-all test-conformance test-rest-conformance test-all-conformance test-slow-conformance test-failing-conformance \ test-vm test-rest-vm test-all-vm test-bchain test-rest-bchain test-all-bchain \ test-web3 test-all-web3 test-failing-web3 \ test-prove test-failing-prove \ test-prove-benchmarks test-prove-functional test-prove-opcodes test-prove-erc20 test-prove-bihu test-prove-examples \ - test-klab-prove \ + test-prove-imp-specs test-klab-prove \ test-parse test-failure \ test-interactive test-interactive-help test-interactive-run test-interactive-prove test-interactive-search \ media media-pdf metropolis-theme .SECONDARY: -all: build split-tests +all: build clean: rm -rf $(DEFN_BASE_DIR) @@ -68,131 +66,108 @@ distclean: # Non-K Dependencies # ------------------ -libsecp256k1_out := $(LIBRARY_PATH)/pkgconfig/libsecp256k1.pc -libff_out := $(LIBRARY_PATH)/libff.a +libsecp256k1_out := $(LOCAL_LIB)/pkgconfig/libsecp256k1.pc +libff_out := $(LOCAL_LIB)/libff.a libsecp256k1: $(libsecp256k1_out) libff: $(libff_out) -$(DEPS_DIR)/secp256k1/autogen.sh: - git submodule update --init --recursive -- $(DEPS_DIR)/secp256k1 - $(libsecp256k1_out): $(DEPS_DIR)/secp256k1/autogen.sh - cd $(DEPS_DIR)/secp256k1/ \ - && ./autogen.sh \ + cd $(DEPS_DIR)/secp256k1/ \ + && ./autogen.sh \ && ./configure --enable-module-recovery --prefix="$(BUILD_LOCAL)" \ - && $(MAKE) \ + && $(MAKE) \ && $(MAKE) install UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) - LIBFF_CMAKE_FLAGS= - LINK_PROCPS=-lprocps + LIBFF_CMAKE_FLAGS= else - LIBFF_CMAKE_FLAGS=-DWITH_PROCPS=OFF - LINK_PROCPS= + LIBFF_CMAKE_FLAGS=-DWITH_PROCPS=OFF endif -LIBFF_CC := clang-8 -LIBFF_CXX := clang++-8 - -$(DEPS_DIR)/libff/CMakeLists.txt: - git submodule update --init --recursive -- $(DEPS_DIR)/libff - $(libff_out): $(DEPS_DIR)/libff/CMakeLists.txt @mkdir -p $(DEPS_DIR)/libff/build - cd $(DEPS_DIR)/libff/build \ - && CC=$(LIBFF_CC) CXX=$(LIBFF_CXX) cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(BUILD_LOCAL) $(LIBFF_CMAKE_FLAGS) \ - && make -s -j4 \ + cd $(DEPS_DIR)/libff/build \ + && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(BUILD_LOCAL) $(LIBFF_CMAKE_FLAGS) \ + && make -s -j4 \ && make install # K Dependencies # -------------- +K_JAR := $(K_SUBMODULE)/k-distribution/target/release/k/lib/java/kernel-1.0-SNAPSHOT.jar + deps: repo-deps repo-deps: tangle-deps k-deps plugin-deps -k-deps: $(K_SUBMODULE)/make.timestamp +k-deps: $(K_JAR) tangle-deps: $(TANGLER) -plugin-deps: $(PLUGIN_SUBMODULE)/make.timestamp +plugin-deps: $(PLUGIN_SUBMODULE)/client-c/main.cpp BACKEND_SKIP=-Dhaskell.backend.skip -Dllvm.backend.skip - ifneq ($(RELEASE),) -K_BUILD_TYPE := FastBuild -SEMANTICS_BUILD_TYPE := Release -KOMPILE_OPTS += -O3 + K_BUILD_TYPE := FastBuild + SEMANTICS_BUILD_TYPE := Release + KOMPILE_OPTS += -O3 else -K_BUILD_TYPE := FastBuild -SEMANTICS_BUILD_TYPE := Debug + K_BUILD_TYPE := FastBuild + SEMANTICS_BUILD_TYPE := Debug endif -$(K_SUBMODULE)/make.timestamp: - git submodule update --init --recursive -- $(K_SUBMODULE) - cd $(K_SUBMODULE) && mvn package -DskipTests -U -Dproject.build.type=${K_BUILD_TYPE} $(BACKEND_SKIP) - touch $(K_SUBMODULE)/make.timestamp - -$(TANGLER): - git submodule update --init -- $(PANDOC_TANGLE_SUBMODULE) - -$(PLUGIN_SUBMODULE)/make.timestamp: - git submodule update --init --recursive -- $(PLUGIN_SUBMODULE) - touch $(PLUGIN_SUBMODULE)/make.timestamp +$(K_JAR): + cd $(K_SUBMODULE) && mvn package -DskipTests -U -Dproject.build.type=$(K_BUILD_TYPE) $(BACKEND_SKIP) # Building # -------- -build-node: MAIN_DEFN_FILE = evm-node -build-node: MAIN_MODULE = EVM-NODE -build-node: SYNTAX_MODULE = EVM-NODE -build-web3: MAIN_DEFN_FILE = web3 -build-web3: MAIN_MODULE = WEB3 -build-web3: SYNTAX_MODULE = WEB3 MAIN_MODULE := ETHEREUM-SIMULATION SYNTAX_MODULE := $(MAIN_MODULE) MAIN_DEFN_FILE := driver -export MAIN_DEFN_FILE -k_files := driver.k data.k network.k evm.k evm-types.k json.k krypto.k edsl.k evm-node.k web3.k asm.k state-loader.k serialization.k +k_files := driver.k data.k network.k evm.k evm-types.k json.k krypto.k edsl.k web3.k asm.k state-loader.k serialization.k evm-imp-specs.k EXTRA_K_FILES += $(MAIN_DEFN_FILE).k ALL_K_FILES := $(k_files) $(EXTRA_K_FILES) llvm_dir := $(DEFN_DIR)/llvm java_dir := $(DEFN_DIR)/java +specs_dir := $(DEFN_DIR)/specs haskell_dir := $(DEFN_DIR)/haskell -node_dir := $(abspath $(DEFN_DIR)/node) web3_dir := $(abspath $(DEFN_DIR)/web3) -export node_dir export web3_dir llvm_files := $(patsubst %, $(llvm_dir)/%, $(ALL_K_FILES)) java_files := $(patsubst %, $(java_dir)/%, $(ALL_K_FILES)) +specs_files := $(patsubst %, $(specs_dir)/%, $(ALL_K_FILES)) haskell_files := $(patsubst %, $(haskell_dir)/%, $(ALL_K_FILES)) -node_files := $(patsubst %, $(node_dir)/%, $(ALL_K_FILES)) web3_files := $(patsubst %, $(web3_dir)/%, $(ALL_K_FILES)) -defn_files := $(llvm_files) $(java_files) $(haskell_files) $(node_files) $(web3_files) +defn_files := $(llvm_files) $(java_files) $(specs_files) $(haskell_files) $(web3_files) java_kompiled := $(java_dir)/$(MAIN_DEFN_FILE)-kompiled/timestamp -node_kompiled := $(DEFN_DIR)/vm/kevm-vm +specs_kompiled := $(specs_dir)/specs-kompiled/timestamp web3_kompiled := $(web3_dir)/build/kevm-client haskell_kompiled := $(haskell_dir)/$(MAIN_DEFN_FILE)-kompiled/definition.kore llvm_kompiled := $(llvm_dir)/$(MAIN_DEFN_FILE)-kompiled/interpreter -node_kore := $(node_dir)/$(MAIN_DEFN_FILE)-kompiled/definition.kore web3_kore := $(web3_dir)/$(MAIN_DEFN_FILE)-kompiled/definition.kore +$(web3_kompiled): MAIN_DEFN_FILE := web3 +$(web3_kompiled): MAIN_MODULE := WEB3 +$(web3_kompiled): SYNTAX_MODULE := WEB3 +$(web3_kompiled): web3_kore := $(web3_dir)/$(MAIN_DEFN_FILE)-kompiled/definition.kore + +export MAIN_DEFN_FILE # Tangle definition from *.md files -concrete_tangle := .k:not(.node):not(.symbolic):not(.nobytes):not(.memmap),.standalone,.concrete,.bytes,.membytes -java_tangle := .k:not(.node):not(.concrete):not(.bytes):not(.memmap):not(.membytes),.standalone,.symbolic,.nobytes -haskell_tangle := .k:not(.node):not(.concrete):not(.nobytes):not(.memmap),.standalone,.symbolic,.bytes,.membytes -node_tangle := .k:not(.standalone):not(.symbolic):not(.nobytes):not(.memmap),.node,.concrete,.bytes,.membytes +concrete_tangle := .k:not(.symbolic):not(.nobytes):not(.memmap),.concrete,.bytes,.membytes +java_tangle := .k:not(.concrete):not(.bytes):not(.memmap):not(.membytes),.symbolic,.nobytes +haskell_tangle := .k:not(.concrete):not(.nobytes):not(.memmap),.symbolic,.bytes,.membytes defn: $(defn_files) llvm-defn: $(llvm_files) java-defn: $(java_files) +specs-defn: $(specs_files) haskell-defn: $(haskell_files) -node-defn: $(node_files) web3-defn: $(web3_files) $(llvm_dir)/%.k: %.md $(TANGLER) @@ -203,88 +178,87 @@ $(java_dir)/%.k: %.md $(TANGLER) @mkdir -p $(java_dir) pandoc --from markdown --to "$(TANGLER)" --metadata=code:"$(java_tangle)" $< > $@ +$(specs_dir)/%.k: %.md $(TANGLER) + @mkdir -p $(specs_dir) + pandoc --from markdown --to "$(TANGLER)" --metadata=code:"$(java_tangle)" $< > $@ + $(haskell_dir)/%.k: %.md $(TANGLER) @mkdir -p $(haskell_dir) pandoc --from markdown --to "$(TANGLER)" --metadata=code:"$(haskell_tangle)" $< > $@ -$(node_dir)/%.k: %.md $(TANGLER) - @mkdir -p $(node_dir) - pandoc --from markdown --to "$(TANGLER)" --metadata=code:"$(node_tangle)" $< > $@ - $(web3_dir)/%.k: %.md $(TANGLER) @mkdir -p $(web3_dir) pandoc --from markdown --to "$(TANGLER)" --metadata=code:"$(concrete_tangle)" $< > $@ # Kompiling -build: build-llvm build-haskell build-java build-web3 build-node +build: build-llvm build-haskell build-java build-specs build-web3 build-java: $(java_kompiled) -build-node: $(node_kompiled) +build-specs: $(specs_kompiled) build-web3: $(web3_kompiled) build-haskell: $(haskell_kompiled) build-llvm: $(llvm_kompiled) -# Java Backend +# Java $(java_kompiled): $(java_files) - $(K_BIN)/kompile --debug --main-module $(MAIN_MODULE) --backend java \ - --syntax-module $(SYNTAX_MODULE) $(java_dir)/$(MAIN_DEFN_FILE).k \ - --directory $(java_dir) -I $(java_dir) \ - $(KOMPILE_OPTS) + kompile --debug --main-module $(MAIN_MODULE) --backend java \ + --syntax-module $(SYNTAX_MODULE) $(java_dir)/$(MAIN_DEFN_FILE).k \ + --directory $(java_dir) -I $(java_dir) \ + $(KOMPILE_OPTS) -# Haskell Backend +# Imperative Specs -$(haskell_kompiled): $(haskell_files) - $(K_BIN)/kompile --debug --main-module $(MAIN_MODULE) --backend haskell --hook-namespaces KRYPTO \ - --syntax-module $(SYNTAX_MODULE) $(haskell_dir)/$(MAIN_DEFN_FILE).k \ - --directory $(haskell_dir) -I $(haskell_dir) \ - $(KOMPILE_OPTS) +$(specs_kompiled): MAIN_DEFN_FILE=evm-imp-specs +$(specs_kompiled): MAIN_MODULE=EVM-IMP-SPECS +$(specs_kompiled): SYNTAX_MODULE=EVM-IMP-SPECS -# Node Backend +$(specs_kompiled): $(specs_files) + kompile --debug --main-module $(MAIN_MODULE) --backend java \ + --syntax-module $(SYNTAX_MODULE) $(specs_dir)/$(MAIN_DEFN_FILE).k \ + --directory $(specs_dir) -I $(specs_dir) \ + $(KOMPILE_OPTS) -$(node_kore): $(node_files) - $(K_BIN)/kompile --debug --main-module $(MAIN_MODULE) --backend llvm \ - --syntax-module $(SYNTAX_MODULE) $(node_dir)/$(MAIN_DEFN_FILE).k \ - --directory $(node_dir) -I $(node_dir) -I $(node_dir) \ - --hook-namespaces "KRYPTO BLOCKCHAIN" \ - --no-llvm-kompile \ - $(KOMPILE_OPTS) +# Haskell -$(node_dir)/$(MAIN_DEFN_FILE)-kompiled/plugin/proto/msg.pb.cc: $(PLUGIN_SUBMODULE)/plugin/proto/msg.proto - @mkdir -p $(node_dir)/$(MAIN_DEFN_FILE)-kompiled/plugin - protoc --cpp_out=$(node_dir)/$(MAIN_DEFN_FILE)-kompiled/plugin -I $(PLUGIN_SUBMODULE)/plugin $(PLUGIN_SUBMODULE)/plugin/proto/msg.proto - -$(node_kompiled): $(node_kore) $(node_dir)/$(MAIN_DEFN_FILE)-kompiled/plugin/proto/msg.pb.cc $(libff_out) - @mkdir -p $(DEFN_DIR)/vm - cd $(DEFN_DIR)/vm && cmake $(CURDIR)/cmake/node -DCMAKE_BUILD_TYPE=${SEMANTICS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} && $(MAKE) +$(haskell_kompiled): $(haskell_files) + kompile --debug --main-module $(MAIN_MODULE) --backend haskell --hook-namespaces KRYPTO \ + --syntax-module $(SYNTAX_MODULE) $(haskell_dir)/$(MAIN_DEFN_FILE).k \ + --directory $(haskell_dir) -I $(haskell_dir) \ + $(KOMPILE_OPTS) -# Web3 Backend +# Web3 $(web3_kore): $(web3_files) - $(K_BIN)/kompile --debug --main-module $(MAIN_MODULE) --backend llvm \ - --syntax-module $(SYNTAX_MODULE) $(web3_dir)/$(MAIN_DEFN_FILE).k \ - --directory $(web3_dir) -I $(web3_dir) \ - --hook-namespaces "KRYPTO JSON" \ - --no-llvm-kompile \ - $(KOMPILE_OPTS) + kompile --debug --main-module $(MAIN_MODULE) --backend llvm \ + --syntax-module $(SYNTAX_MODULE) $(web3_dir)/$(MAIN_DEFN_FILE).k \ + --directory $(web3_dir) -I $(web3_dir) \ + --hook-namespaces "KRYPTO JSON" \ + --no-llvm-kompile \ + $(KOMPILE_OPTS) $(web3_kompiled): $(web3_kore) $(libff_out) @mkdir -p $(web3_dir)/build - cd $(web3_dir)/build && cmake $(CURDIR)/cmake/client -DCMAKE_BUILD_TYPE=${SEMANTICS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} && $(MAKE) + cd $(web3_dir)/build && cmake $(CURDIR)/cmake/client -DCMAKE_BUILD_TYPE=$(SEMANTICS_BUILD_TYPE) && $(MAKE) + +# Standalone + +STANDALONE_KOMPILE_OPTS := -L$(LOCAL_LIB) -I$(K_RELEASE)/include/kllvm \ + $(PLUGIN_SUBMODULE)/plugin-c/crypto.cpp \ + $(PLUGIN_SUBMODULE)/plugin-c/blake2.cpp \ + -g -std=c++14 -lff -lcryptopp -lsecp256k1 -# LLVM Backend +ifeq ($(UNAME_S),Linux) + STANDALONE_KOMPILE_OPTS += -lprocps +endif $(llvm_kompiled): $(llvm_files) $(libff_out) - $(K_BIN)/kompile --debug --main-module $(MAIN_MODULE) --backend llvm \ - --syntax-module $(SYNTAX_MODULE) $(llvm_dir)/$(MAIN_DEFN_FILE).k \ - --directory $(llvm_dir) -I $(llvm_dir) -I $(llvm_dir) \ - --hook-namespaces KRYPTO \ - $(KOMPILE_OPTS) \ - -ccopt $(PLUGIN_SUBMODULE)/plugin-c/crypto.cpp \ - -ccopt $(PLUGIN_SUBMODULE)/plugin-c/blake2.cpp \ - -ccopt -g -ccopt -std=c++14 \ - -ccopt -L$(LIBRARY_PATH) \ - -ccopt -lff -ccopt -lcryptopp -ccopt -lsecp256k1 $(addprefix -ccopt ,$(LINK_PROCPS)) + kompile --debug --main-module $(MAIN_MODULE) --backend llvm \ + --syntax-module $(SYNTAX_MODULE) $(llvm_dir)/$(MAIN_DEFN_FILE).k \ + --directory $(llvm_dir) -I $(llvm_dir) \ + --hook-namespaces KRYPTO \ + $(KOMPILE_OPTS) \ + $(addprefix -ccopt ,$(STANDALONE_KOMPILE_OPTS)) # Installing # ---------- @@ -318,12 +292,6 @@ KPROVE_OPTIONS := test-all: test-all-conformance test-prove test-interactive test-parse test: test-conformance test-prove test-interactive test-parse -split-tests: tests/ethereum-tests/make.timestamp - -tests/%/make.timestamp: - git submodule update --init -- tests/$* - touch $@ - # Generic Test Harnesses tests/ethereum-tests/VMTests/%: KEVM_MODE=VMTESTS @@ -366,7 +334,8 @@ tests/specs/functional/%.prove: TEST_SYMBOLIC_BACKEND=haskell tests/specs/examples/%.prove: TEST_SYMBOLIC_BACKEND=haskell tests/specs/functional/storageRoot-spec.k.prove: TEST_SYMBOLIC_BACKEND=java -tests/specs/functional/lemmas-spec.k.prove: TEST_SYMBOLIC_BACKEND=java +tests/specs/functional/lemmas-no-smt-spec.k.prove: KPROVE_OPTIONS+=--haskell-backend-command "kore-exec --smt=none" +tests/specs/erc20/hkg/totalSupply-spec.k.prove: TEST_SYMBOLIC_BACKEND=haskell tests/%.prove: tests/% $(TEST) prove $(TEST_OPTIONS) --backend $(TEST_SYMBOLIC_BACKEND) $< $(KPROVE_MODULE) --format-failures $(KPROVE_OPTIONS) \ @@ -374,6 +343,13 @@ tests/%.prove: tests/% $(CHECK) $@.out $@.expected rm -rf $@.out +tests/specs/imp-specs/%.prove: tests/specs/imp-specs/% + $(TEST) prove $(TEST_OPTIONS) --backend-dir $(specs_dir) \ + --backend $(TEST_SYMBOLIC_BACKEND) $< $(KPROVE_MODULE) --format-failures $(KPROVE_OPTIONS) \ + --concrete-rules $(shell cat $(dir $@)concrete-rules.txt | tr '\n' ',') > $@.out || \ + $(CHECK) $@.out $@.expected + rm -rf $@.out + tests/%.search: tests/% $(TEST) search $(TEST_OPTIONS) --backend $(TEST_SYMBOLIC_BACKEND) $< " EVMC_INVALID_INSTRUCTION " > $@-out $(CHECK) $@-out $@-expected @@ -443,14 +419,16 @@ prove_opcodes_tests := $(filter-out $(prove_failing_tests), $(wildcard $(prov prove_erc20_tests := $(filter-out $(prove_failing_tests), $(wildcard $(prove_specs_dir)/erc20/*/*-spec.k)) prove_bihu_tests := $(filter-out $(prove_failing_tests), $(wildcard $(prove_specs_dir)/bihu/*-spec.k)) prove_examples_tests := $(filter-out $(prove_failing_tests), $(wildcard $(prove_specs_dir)/examples/*-spec.k)) +prove_imp_specs_tests := $(filter-out $(prove_failing_tests), $(wildcard $(prove_specs_dir)/imp-specs/*-spec.k)) -test-prove: test-prove-benchmarks test-prove-functional test-prove-opcodes test-prove-erc20 test-prove-bihu test-prove-examples +test-prove: test-prove-benchmarks test-prove-functional test-prove-opcodes test-prove-erc20 test-prove-bihu test-prove-examples test-prove-imp-specs test-prove-benchmarks: $(prove_benchmarks_tests:=.prove) test-prove-functional: $(prove_functional_tests:=.prove) test-prove-opcodes: $(prove_opcodes_tests:=.prove) test-prove-erc20: $(prove_erc20_tests:=.prove) test-prove-bihu: $(prove_bihu_tests:=.prove) test-prove-examples: $(prove_examples_tests:=.prove) +test-prove-imp-specs: $(prove_imp_specs_tests:=.prove) test-failing-prove: $(prove_failing_tests:=.prove) @@ -504,6 +482,4 @@ media-pdf: $(patsubst %, media/%.pdf, $(media_pdfs)) metropolis-theme: $(BUILD_DIR)/media/metropolis/beamerthememetropolis.sty $(BUILD_DIR)/media/metropolis/beamerthememetropolis.sty: - git submodule update --init -- $(dir $@) cd $(dir $@) && $(MAKE) - diff --git a/README.md b/README.md index 4ea471418f..745c492b50 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,18 @@ Repository Structure The following files constitute the KEVM semantics: - [krypto.md](krypto.md) sets up some basic cryptographic primitives. -- [data.md](data.md) provides the (functional) data of EVM (256 bit words, wordstacks, etc...). - [network.md](network.md) provides the status codes which are reported to an Ethereum client on execution exceptions. +- [json.md](json.md) is an implementation of the JSON format in K. +- [evm-types.md](evm-types.md) provides the (functional) data of EVM (256 bit words, wordstacks, etc...). +- [serialization.md](serialization.md) provides helpers for parsing and unparsing data (hex strings, recursive-length prefix, merkle trees, etc.). - [evm.md](evm.md) is the main KEVM semantics, containing the configuration and transition rules of EVM. These additional files extend the semantics to make the repository more useful: -- [driver.md](driver.md) is an execution harness for KEVM, providing a simple language for describing tests/programs. - [edsl.md](edsl.md) defines high-level notations of [eDSL], a domain-specific language for EVM specifications, for formal verification of EVM bytecode using [K Reachability Logic Prover]. -- [evm-node.md](evm-node.md) is the protobuf interface that an external Ethereum client can connect to for using KEVM as the execution engine. +- [state-loader.md](state-loader.md) provides common functionality between driver and web3 for EVM initialization and setup. +- [driver.md](driver.md) is an execution harness for KEVM, providing a simple language for describing tests/programs. +- [web3.md](web3.md) is a web3 rpc server. Installing/Building ------------------- @@ -49,16 +52,17 @@ The following are needed for building/running KEVM: - GNU [libmpfr](http://www.mpfr.org/) and [libtool](https://www.gnu.org/software/libtool/). - Java 8 JDK (eg. [OpenJDK](http://openjdk.java.net/)) +For the exact dependencies check the Dockerfile, but they should look something like this. On Ubuntu >= 18.04 (for example): ```sh -sudo apt install \ - autoconf bison clang++-8 clang-8 cmake curl flex gcc git \ - libboost-test-dev libgmp-dev libjemalloc-dev libmpfr-dev \ - libprocps-dev libprotobuf-dev libsecp256k1-dev libtool \ - libyaml-dev libz3-dev lld-8 llvm-8 llvm-8-tools make maven \ - openjdk-11-jdk pandoc pkg-config protobuf-compiler z3 \ - zlib1g-dev +sudo apt-get install --yes \ + autoconf bison clang-8 cmake curl flex gcc jq libboost-test-dev \ + libcrypto++-dev libffi-dev libgflags-dev libjemalloc-dev libmpfr-dev \ + libprocps-dev libsecp256k1-dev libssl-dev libtool libyaml-dev \ + lld-8 llvm-8-tools make maven netcat-openbsd openjdk-11-jdk \ + pandoc pkg-config python3 python-pygments python-recommonmark \ + python-sphinx rapidjson-dev time zlib1g-dev ``` On Ubuntu < 18.04, you'll need to skip `libsecp256k1-dev` and instead build it from source (via our `Makefile`): @@ -103,39 +107,21 @@ export PATH=$HOME/.local/bin:$PATH ### Build K Dependency -Get the submodules: - -```sh -git submodule update --init --recursive -``` - -And finally build the repository specific dependencies: - -```sh -make RELEASE=1 deps -``` -If you are a developer, you probably should omit `RELEASE` from the above commands unless you are testing performance, as the build is somewhat slower. - -On Arch, instead do: +The `Makefile` and `kevm` will work with either a (i) globally installed K, or (ii) the submodule built K. +If you want to use the submodule, follow these instructions, then get the submodules and build the repository dependencies: ```sh -make LIBFF_CC=clang LIBFF_CXX=clang++ RELEASE=1 deps +git submodule update --init --recursive -- deps/k +make deps ``` ### Building -Finally, you can install repository specific dependencies and build the semantics: - -```sh -make build RELEASE=1 -``` - -You can also build specific backends as so: +Finally, you can build the semantics (after getting the plugin and tangle submodule dependencies): ```sh -make build-haskell -make build-llvm RELEASE=1 -make build-java +git submodule update --init --recursive -- deps/plugin deps/pandoc-tangle +make build ``` Example Usage diff --git a/cmake/client/CMakeLists.txt b/cmake/client/CMakeLists.txt index 13f700d7c1..5dd5b97232 100644 --- a/cmake/client/CMakeLists.txt +++ b/cmake/client/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required (VERSION 3.4) list(APPEND CMAKE_MODULE_PATH "$ENV{K_RELEASE}/cmake") +list(APPEND CMAKE_MODULE_PATH "$ENV{K_RELEASE}/lib/cmake/kframework") include(LLVMKompilePrelude) project (KevmClient CXX) @@ -9,7 +10,7 @@ set(KOMPILE_USE_MAIN "library") set(TARGET_NAME "kevm-client") add_executable(kevm-client - $ENV{PLUGIN_SUBMODULE}/vm-c/init.cpp + $ENV{PLUGIN_SUBMODULE}/client-c/init.cpp $ENV{PLUGIN_SUBMODULE}/client-c/main.cpp $ENV{PLUGIN_SUBMODULE}/client-c/json.cpp $ENV{PLUGIN_SUBMODULE}/plugin-c/crypto.cpp @@ -21,14 +22,14 @@ endif() target_include_directories(kevm-client PUBLIC $ENV{PLUGIN_SUBMODULE}/plugin-c - PUBLIC $ENV{PLUGIN_SUBMODULE}/vm-c - PUBLIC $ENV{PLUGIN_SUBMODULE}/deps/websocketpp + PUBLIC $ENV{PLUGIN_SUBMODULE}/deps/cpp-httplib + PUBLIC $ENV{K_RELEASE}/include/kllvm PUBLIC ${CMAKE_SOURCE_DIR}/..) target_compile_options(kevm-client PUBLIC $ENV{LLVM_KOMPILE_OPTS} PUBLIC -Wall -Werror -Wno-unknown-warning-option) target_link_libraries(kevm-client - ff gmp ${LINK_PROCPS} cryptopp secp256k1 gflags boost_system + ff gmp ${LINK_PROCPS} cryptopp secp256k1 gflags ) include(LLVMKompile) diff --git a/cmake/node/CMakeLists.txt b/cmake/node/CMakeLists.txt deleted file mode 100644 index 824b874d2a..0000000000 --- a/cmake/node/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -cmake_minimum_required (VERSION 3.4) - -list(APPEND CMAKE_MODULE_PATH "$ENV{K_RELEASE}/cmake") -include(LLVMKompilePrelude) -project (KevmVm CXX) - -set(KOMPILED_DIR $ENV{node_dir}/$ENV{MAIN_DEFN_FILE}-kompiled) -set(KOMPILE_USE_MAIN "library") -set(TARGET_NAME "kevm-vm") - -link_directories(AFTER SYSTEM $ENV{LIBRARY_PATH}) - -add_executable(kevm-vm - $ENV{PLUGIN_SUBMODULE}/vm-c/init.cpp - $ENV{PLUGIN_SUBMODULE}/vm-c/main.cpp - $ENV{PLUGIN_SUBMODULE}/vm-c/vm.cpp - $ENV{PLUGIN_SUBMODULE}/plugin-c/blake2.cpp - $ENV{PLUGIN_SUBMODULE}/plugin-c/blockchain.cpp - $ENV{PLUGIN_SUBMODULE}/plugin-c/crypto.cpp - $ENV{PLUGIN_SUBMODULE}/plugin-c/world.cpp - $ENV{node_dir}/$ENV{MAIN_DEFN_FILE}-kompiled/plugin/proto/msg.pb.cc - $ENV{PLUGIN_SUBMODULE}/vm-c/kevm/semantics.cpp) - -if(UNIX AND NOT APPLE) - set(LINK_PROCPS procps) -endif() - -target_include_directories(kevm-vm - PUBLIC $ENV{PLUGIN_SUBMODULE}/plugin-c - PUBLIC $ENV{node_dir}/$ENV{MAIN_DEFN_FILE}-kompiled/plugin - PUBLIC $ENV{PLUGIN_SUBMODULE}/vm-c - PUBLIC $ENV{PLUGIN_SUBMODULE}/vm-c/kevm - PUBLIC ${CMAKE_SOURCE_DIR}/..) -target_compile_options(kevm-vm - PUBLIC $ENV{LLVM_KOMPILE_OPTS} - PUBLIC -Wall -Werror) -target_link_libraries(kevm-vm - ff protobuf gmp ${LINK_PROCPS} cryptopp secp256k1) - -include(LLVMKompile) diff --git a/data.md b/data.md index b592193fbf..b073e389ad 100644 --- a/data.md +++ b/data.md @@ -16,7 +16,7 @@ module EVM-DATA imports STRING-BUFFER imports MAP-SYMBOLIC imports COLLECTIONS - imports JSON + imports JSON-EXT ``` ```{.k .concrete .bytes} diff --git a/deps/k b/deps/k index 280480e6e4..5396aae9ab 160000 --- a/deps/k +++ b/deps/k @@ -1 +1 @@ -Subproject commit 280480e6e415f4f2c570198ee577f9dbeec33fcb +Subproject commit 5396aae9abfd2a6899207ac4e8fba1dfe6681f49 diff --git a/deps/plugin b/deps/plugin index 1d4f18a463..1081ab8770 160000 --- a/deps/plugin +++ b/deps/plugin @@ -1 +1 @@ -Subproject commit 1d4f18a463aa35b4f0cac8dbdca3adacf58305f9 +Subproject commit 1081ab8770979703830f0f867ca105b2480f9e50 diff --git a/driver.md b/driver.md index f5a3ce7cb6..be4092a3ce 100644 --- a/driver.md +++ b/driver.md @@ -39,25 +39,6 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a ```k syntax JSON ::= ByteArray | OpCodes | Map | Call | SubstateLogEntry | Account // ----------------------------------------------------------------------------- - - syntax JSONs ::= #sortJSONs ( JSONs ) [function] - | #sortJSONs ( JSONs , JSONs ) [function, klabel(#sortJSONsAux)] - // ------------------------------------------------------------------------------- - rule #sortJSONs(JS) => #sortJSONs(JS, .JSONs) - rule #sortJSONs(.JSONs, LS) => LS - rule #sortJSONs(((KEY : VAL) , REST), LS) => #insertJSONKey((KEY : VAL), #sortJSONs(REST, LS)) - - syntax JSONs ::= #insertJSONKey ( JSON , JSONs ) [function] - // ----------------------------------------------------------- - rule #insertJSONKey( JS , .JSONs ) => JS , .JSONs - rule #insertJSONKey( (KEY : VAL) , ((KEY' : VAL') , REST) ) => (KEY : VAL) , (KEY' : VAL') , REST requires KEY (KEY' : VAL') , #insertJSONKey((KEY : VAL) , REST) requires KEY >=String KEY' - - syntax Bool ::= #isSorted ( JSONs ) [function] - // ---------------------------------------------- - rule #isSorted( .JSONs ) => true - rule #isSorted( KEY : _ ) => true - rule #isSorted( (KEY : _) , (KEY' : VAL) , REST ) => KEY <=String KEY' andThenBool #isSorted((KEY' : VAL) , REST) ``` ### Driving Execution @@ -89,7 +70,8 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a rule startTx => #finalizeBlock ... .List - rule startTx => loadTx(#sender(TN, TP, TG, TT, TV, #unparseByteStack(DATA), TW, TR, TS)) ... + rule startTx => loadTx(#sender(TN, TP, TG, TT, TV, #unparseByteStack(DATA), TW, TR, TS, CID)) ... + CID ListItem(TXID:Int) ... TXID @@ -107,8 +89,7 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a syntax EthereumCommand ::= loadTx ( Account ) // --------------------------------------------- rule loadTx(ACCTFROM) - => #loadAccount #newAddr(ACCTFROM, NONCE) - ~> #create ACCTFROM #newAddr(ACCTFROM, NONCE) VALUE CODE + => #create ACCTFROM #newAddr(ACCTFROM, NONCE) VALUE CODE ~> #finishTx ~> #finalizeTx(false) ~> startTx ... @@ -137,9 +118,7 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a _ => SetItem(MINER) rule loadTx(ACCTFROM) - => #loadAccount ACCTTO - ~> #lookupCode ACCTTO - ~> #call ACCTFROM ACCTTO ACCTTO VALUE VALUE DATA false + => #call ACCTFROM ACCTTO ACCTTO VALUE VALUE DATA false ~> #finishTx ~> #finalizeTx(false) ~> startTx ... @@ -213,7 +192,11 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a syntax EthereumCommand ::= "failure" String | "success" // ------------------------------------------------------- - rule success => . ... _ => 0 _ => SUCCESS + rule success => . ... + _ => 0 + _ => SUCCESS + _ => 0 + rule failure _ => . ... rule #halt ~> failure _ => . ... ``` @@ -229,7 +212,7 @@ Note that `TEST` is sorted here so that key `"network"` comes before key `"pre"` // ------------------------------------- rule run { .JSONs } => . ... rule run { TESTID : { TEST:JSONs } , TESTS } - => run ( TESTID : { #sortJSONs(TEST) } ) + => run ( TESTID : { qsortJSONs(TEST) } ) ~> #if #hasPost?( { TEST } ) #then .K #else exception #fi ~> clear ~> run { TESTS } @@ -316,7 +299,7 @@ Note that `TEST` is sorted here so that key `"network"` comes before key `"pre"` - `driver.md` specific handling of state-loader commands -```{.k .standalone} +```k rule load "account" : { ACCTID : ACCT } => loadAccount ACCTID ACCT ... rule loadAccount _ { "balance" : ((VAL:String) => #parseWord(VAL)), _ } ... @@ -353,8 +336,8 @@ Note that `TEST` is sorted here so that key `"network"` comes before key `"pre"` rule check DATA : [ { TEST } , REST ] => check DATA : { TEST } ~> check DATA : [ REST ] ... requires DATA =/=String "transactions" - rule check (KEY:String) : { JS:JSONs => #sortJSONs(JS) } ... - requires KEY in (SetItem("callcreates")) andBool notBool #isSorted(JS) + rule check (KEY:String) : { JS:JSONs => qsortJSONs(JS) } ... + requires KEY in (SetItem("callcreates")) andBool notBool sortedJSONs(JS) rule check TESTID : { "post" : POST } => check "account" : POST ~> failure TESTID ... rule check "account" : { ACCTID:Int : { KEY : VALUE , REST } } => check "account" : { ACCTID : { KEY : VALUE } } ~> check "account" : { ACCTID : { REST } } ... diff --git a/edsl.md b/edsl.md index 2935c1772e..2e50e2c5ad 100644 --- a/edsl.md +++ b/edsl.md @@ -54,9 +54,11 @@ where `F1 : F2 : F3 : F4` is the (two's complement) byte-array representation of syntax ByteArray ::= #abiCallData ( String , TypedArgs ) [function] // ------------------------------------------------------------------- - rule #abiCallData( FNAME , ARGS ) - => #parseByteStack(substrString(Keccak256(#generateSignature(FNAME, ARGS)), 0, 8)) - ++ #encodeArgs(ARGS) + rule #abiCallData( FNAME , ARGS ) => #signatureCallData(FNAME, ARGS) ++ #encodeArgs(ARGS) + + syntax ByteArray ::= #signatureCallData ( String, TypedArgs ) [function] + // ------------------------------------------------------------------------ + rule #signatureCallData( FNAME , ARGS ) => #parseByteStack(substrString(Keccak256(#generateSignature(FNAME, ARGS)), 0, 8)) syntax String ::= #generateSignature ( String, TypedArgs ) [function] | #generateSignatureArgs ( TypedArgs ) [function] @@ -183,6 +185,8 @@ where `F1 : F2 : F3 : F4` is the (two's complement) byte-array representation of requires #range(0 <= DATA < (2 ^Int (SIZE *Int 8))) [concrete] + rule #Ceil(#buf(SIZE, DATA)) => {(0 <=Int SIZE) andBool #rangeBytes(SIZE, DATA) #Equals true} [anywhere, simplification] + syntax Int ::= #getValue ( TypedArg ) [function] // ------------------------------------------------ rule #getValue(#uint160( DATA )) => DATA diff --git a/evm-imp-specs.md b/evm-imp-specs.md new file mode 100644 index 0000000000..6970a576ee --- /dev/null +++ b/evm-imp-specs.md @@ -0,0 +1,144 @@ +Scripting language for imperative specifications (SOLAR-style) +============================================================== + +```k +requires "evm.k" + +module EVM-IMP-SPECS + imports ID + imports EVM + + configuration + + + .Map + +``` + +Core specification language +--------------------------- + +```k + syntax EthereumCommand ::= "#assert" Exp [strict] + | "#assertFailure" Exp + rule #assert R:Bool => . ... + requires R + + rule #assert R:Bool => #assertFailure R ... + requires notBool R + + syntax EthereumCommand ::= "#assume" Exp [strict] + + //Adapted from driver.md `failure` + syntax EthereumCommand ::= "#takeHalt" String + // --------------------------------------------- + rule #takeHalt _ => . ... + rule #halt ~> #takeHalt _ => . ... + + //Shortcut for #mkCall and required setup + syntax EthereumCommand ::= "#mkCallShortcut" Id Int Int ByteArray Id + rule #mkCallShortcut V_CONF_BACKUP CALLER_ID ACCT_ID ARGS V_SAVEOUT_ID + => #restoreEthereum V_CONF_BACKUP + ~> #mkCall CALLER_ID ACCT_ID ACCT_ID PARSEDCODE 0 ARGS false + ~> #takeHalt "failure" + ~> #saveOutput V_SAVEOUT_ID + ... + + ACCT_ID + PARSEDCODE + + //Dummy command at the beginning of to ensure execution doesn't start with a spec rule + syntax EthereumCommand ::= "#dummy" + rule #dummy => . ... +``` + +Configuration access commands +----------------------------- + +```k + syntax EthereumCommand ::= "#saveEthereum" Id + rule #saveEthereum X => . ... + ETH + VARS => VARS[X <- ETH] + + syntax EthereumCommand ::= "#restoreEthereum" Id + rule #restoreEthereum X => . ... + ( _ => ETH ) + ... X |-> ETH ... + + syntax EthereumCommand ::= "#saveOutput" Id + rule #saveOutput X => . ... + OUT + VARS => VARS[X <- OUT] + + syntax EthereumCommand ::= "#saveStorage" Int Id + rule #saveStorage ACCT_ID X => . ... + ACCT_ID + S + VARS => VARS[X <- S] + + syntax EthereumCommand ::= "#saveLog" Id + rule #saveLog X => . ... + L + VARS => VARS[X <- L] + + syntax EthereumCommand ::= "#saveRefund" Id + rule #saveRefund X => . ... + R + VARS => VARS[X <- R] +``` + +Specification expression language +--------------------------------- + +```k + syntax KResult ::= ByteArray | StatusCode | List | Map + + syntax Exp ::= Exp "==S" Exp [seqstrict] + | Exp "=/=S" Exp [seqstrict] + | Exp "+List" Exp [seqstrict] + | KResult + + rule R1:KResult ==S R2:KResult => R1 ==K R2 ... + rule R1:KResult =/=S R2:KResult => R1 =/=K R2 ... + rule L1:List +List L2:List => L1 L2 ... + + // Boolean expressions + syntax Exp ::= Exp "&&S" Exp [seqstrict, left] + > Exp "||S" Exp [seqstrict, left] + + rule R1:Bool &&S R2:Bool => R1 andBool R2 ... + rule R1:Bool ||S R2:Bool => R1 orBool R2 ... + + // Configuration access and other helpers + syntax Exp ::= "#getStatusCode" + | "#getOutput" + | "#getLog" + | "#getRefund" + | #getStorage ( Int ) + | #var( Id ) + | #sizeByteArrayExp ( Exp ) [strict] + + rule #getStatusCode => SC ... + SC + + rule #getOutput => OUT ... + OUT + + rule #getLog => L ... + L + + rule #getRefund => R ... + R + + rule #getStorage(ACCT_ID) => S ... + ACCT_ID + S + + rule #var(X) => VARS[X] ... + VARS + + rule #sizeByteArrayExp(WS:ByteArray) => #sizeByteArray(WS) ... + +endmodule +``` diff --git a/evm-node.md b/evm-node.md deleted file mode 100644 index f522260956..0000000000 --- a/evm-node.md +++ /dev/null @@ -1,266 +0,0 @@ -EVM Integration with Production Client -====================================== - -Contained in this file is glue code needed in order to enable the ability to use KEVM as a VM for an actual Ethereum node. - -```{.k .node} -requires "evm.k" - -module EVM-NODE - imports EVM - imports K-REFLECTION - imports COLLECTIONS - imports BYTES -``` - -### State loading operations. - -In order to enable scalable execution of transactions on an entire blockchain, it is necessary to avoid serializing/deserializing the entire state of all accounts when constructing the initial configuration for KEVM. -To do this, we assume that accounts not present in the `` cell might not exist and need to be loaded on each access. -We also defer loading of storage entries and the actual code byte string until it is needed. -Because the same account may be loaded more than once, implementations of this interface are expected to cache the actual query to the Ethereum client. - -- `#unloaded` represents the code of an account that has not had its code loaded yet. Unloaded code may not be empty. -- Empty code is detected without lazy evaluation by means of checking the code hash, and therefore will always be represented in the `` cell as `.WordStack`. - -```{.k .node} - syntax AccountCode ::= #unloaded(Int) -``` - -- `#getBalance` returns the balance of an account that exists based on its integer address. -- `#getNonce` returns the nonce of an account that exists based on its integer address. -- `#isCodeEmpty` returns true if the code hash of the account is equal to the hash of the empty string, and false otherwise. -- `#accountExists` returns true if the account is present in the state trie for the current block, and false otherwise. - -```{.k .node} - syntax Int ::= #getBalance ( Int ) [function, hook(BLOCKCHAIN.getBalance)] - | #getNonce ( Int ) [function, hook(BLOCKCHAIN.getNonce)] - | #getCodeHash ( Int ) [function, hook(BLOCKCHAIN.getCodeHash)] - // ----------------------------------------------------------------------------- - - syntax Bool ::= #isCodeEmpty ( Int ) [function, hook(BLOCKCHAIN.isCodeEmpty)] - | #accountExists ( Int ) [function, hook(BLOCKCHAIN.accountExists)] - // --------------------------------------------------------------------------------- -``` - -- `#loadAccount` loads an account's balance and nonce if it exists, and leaves the code and storage unloaded, except if the code is empty, in which case the code is fully loaded. - If the account does not exist, it does nothing. - -```{.k .node} - rule #loadAccount ACCT => . ... - ACCTS (.Set => SetItem(ACCT)) - - ( .Bag - => - ACCT - #getBalance(ACCT) - #if #isCodeEmpty(ACCT) #then .ByteArray #else #unloaded(#getCodeHash(ACCT)) #fi - .Map - .Map - #getNonce(ACCT) - - ) - ... - - requires notBool ACCT in ACCTS andBool #accountExists(ACCT) - - rule #loadAccount ACCT => . ... - ACCTS - requires ACCT in ACCTS orBool notBool #accountExists(ACCT) -``` - -- `#getStorageData` loads the value for a single storage key of a specified account by its address and storage offset. - If the storage key has already been loaded or the account does not exist, it does nothing. - -```{.k .node} - syntax Int ::= #getStorageData ( Int , Int ) [function, hook(BLOCKCHAIN.getStorageData)] - // ---------------------------------------------------------------------------------------- - rule #lookupStorage ACCT INDEX => . ... - - ACCT - STORAGE => STORAGE [ INDEX <- #getStorageData(ACCT, INDEX) ] - ORIGSTORAGE => ORIGSTORAGE [ INDEX <- #getStorageData(ACCT, INDEX) ] - ... - - requires notBool INDEX in_keys(STORAGE) - - rule #lookupStorage ACCT INDEX => . ... - - ACCT - STORAGE:Map - ... - - requires INDEX in_keys(STORAGE) - - rule #lookupStorage ACCT _ => . ... - requires notBool #accountExists(ACCT) -``` - -- `#getCode` loads the code for a specified account by its address. If the code has already been loaded, it does nothing. - If the account does not exist, it also does nothing. - -```{.k .node} - syntax String ::= #getCode ( Int ) [function, hook(BLOCKCHAIN.getCode)] - // ----------------------------------------------------------------------- - rule #lookupCode ACCT => . ... - - ACCT - #unloaded(_) => #parseByteStackRaw(#getCode(ACCT)) - ... - - - rule #lookupCode ACCT => . ... - - ACCT - _:ByteArray - ... - - - rule #lookupCode ACCT => . ... - requires notBool #accountExists(ACCT) -``` - -- `#getBlockhash(N)` returns the blockhash of the Nth most recent block, up to a maximum of 256 blocks. - It is used in the implementation of the BLOCKHASH instruction as seen below. - -```{.k .node} - syntax Int ::= #getBlockhash ( Int ) [function, hook(BLOCKCHAIN.getBlockhash)] - // ------------------------------------------------------------------------------ - rule BLOCKHASH N => #getBlockhash(N) ~> #push ... NORMAL requires N >=Int 0 andBool N BLOCKHASH N => 0 ~> #push ... NORMAL requires N =Int 256 -``` - -```{.k .node} - rule EXTCODEHASH ACCT => HASH ~> #push ... - - ACCT - #unloaded(HASH) - NONCE - BAL - ... - -``` - -### Transaction Execution - -- `runVM` takes all the input state of a transaction and the current block header and executes the transaction according to the specified state, relying on the above loading operations for access to accounts and block hashes. - The signature of this function must match the signature expected by VM.ml in the blockchain-k-plugin. - -```{.k .node} - syntax EthereumSimulation ::= runVM ( iscreate: Bool , to: Int , from: Int , code: String , args: String , value: Int , gasprice: Int - , gas: Int , beneficiary: Int , difficulty: Int , number: Int , gaslimit: Int , timestamp: Int , unused: String ) [symbol] - // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - rule (.K => #loadAccount ACCTFROM) ~> runVM(... from: ACCTFROM) ... - .Set - - rule runVM(true, _, ACCTFROM, _, ARGS, VALUE, GPRICE, GAVAIL, CB, DIFF, NUMB, GLIMIT, TS, _) - => #loadAccount #newAddr(ACCTFROM, NONCE -Int 1) - ~> #create ACCTFROM #newAddr(ACCTFROM, NONCE -Int 1) VALUE #parseByteStackRaw(ARGS) - ~> #codeDeposit #newAddr(ACCTFROM, NONCE -Int 1) - ~> #endCreate - ... - - SCHED - _ => GPRICE - _ => GAVAIL - _ => ACCTFROM - _ => -1 - _ => CB - _ => DIFF - _ => NUMB - _ => GLIMIT - _ => TS - - ACCTFROM - NONCE - ... - - _ => SetItem(CB) - ACCTS - requires ACCTFROM in ACCTS - - rule runVM(false, ACCTTO, ACCTFROM, _, ARGS, VALUE, GPRICE, GAVAIL, CB, DIFF, NUMB, GLIMIT, TS, _) - => #loadAccount ACCTTO - ~> #lookupCode ACCTTO - ~> #call ACCTFROM ACCTTO ACCTTO VALUE VALUE #parseByteStackRaw(ARGS) false - ~> #endVM - ... - - SCHED - _ => GPRICE - _ => GAVAIL - _ => ACCTFROM - _ => -1 - _ => CB - _ => DIFF - _ => NUMB - _ => GLIMIT - _ => TS - _ => SetItem(CB) - ACCTS - requires ACCTFROM in ACCTS -``` - -- `#endCreate` and `#endVM` clean up after the transaction finishes and store the return status code of the top level call frame on the top of the `` cell. - -```{.k .node} - syntax KItem ::= "#endVM" | "#endCreate" - // ---------------------------------------- - rule _:ExceptionalStatusCode - #halt ~> #endVM => #popCallStack ~> #popWorldState ~> 0 - _ => .ByteArray - - rule EVMC_REVERT - #halt ~> #endVM => #popCallStack ~> #popWorldState ~> #refund GAVAIL ~> 0 - GAVAIL - - rule EVMC_SUCCESS - #halt ~> #endVM => #popCallStack ~> #dropWorldState ~> #refund GAVAIL ~> 1 - GAVAIL - - rule #endCreate => W ... W : WS -``` - -### Primitive operations expected to exist by the blockchain-k-plugin - -- `vmResult` represents the extracted information about the world state after the transaction finishes. - Its signature must match the signature expected by VM.ml in the blockchain-k-plugin. -- `extractConfig` takes a final configuration after rewriting and extracts a `vmResult` from it in order to abstract away configuration structure from the postprocessing done by the blockchain-k-plugin. - -```{.k .node} - syntax KItem ::= vmResult ( return: String , gas: Int , refund: Int , status: Int , selfdestruct: Set , logs: List , AccountsCell , touched: Set , statusCode: String ) - syntax KItem ::= extractConfig() [function, symbol] - // --------------------------------------------------- - rule [[ extractConfig() => vmResult(#unparseByteStack(OUT), GAVAIL, REFUND, STATUS, SD, LOGS, ACCTS , TOUCHED, StatusCode2String(STATUSCODE)) ]] - OUT - GAVAIL - REFUND - STATUS:Int - SD - LOGS - ACCTS - TOUCHED - STATUSCODE -``` - -- `contractBytes` takes the contents of the `` cell and returns its binary representation as a String. - -```{.k .node} - syntax String ::= contractBytes(AccountCode) [function, symbol] - // --------------------------------------------------------------- - rule contractBytes(WS) => #unparseByteStack(WS) -``` - -The following are expected to exist in the client, but are already defined in [data.md]. - -- `accountEmpty` takes the contents of the `` cell, the contents of the `` cell, and the contents of the `` cell and returns true if the account is empty according to the semantics of EIP161 (i.e., empty code zero balance zero nonce). -- `unparseByteStack` takes a WordStack and returns the corresponding byte String. -- `initKevmCell` is the top cell initializer used to construct an initial configuration. - The configuration is expected to have `$MODE`, `$PGM`, and `$SCHEDULE` parameters. -- `logEntry` is an entry in the log data created by a transaction. - It is expected to consist of an Int address, a List of Int topics, and a WordStack of data. -- `NORMAL` is the value of `$MODE` used by actual transaction execution. - -```{.k .node} -endmodule -``` diff --git a/evm-types.md b/evm-types.md index 866b83b3de..81b8e73888 100644 --- a/evm-types.md +++ b/evm-types.md @@ -99,6 +99,7 @@ These can be used for pattern-matching on the LHS of rules as well (`macro` attr rule #rangeUInt ( 16 , X ) => #range ( minUInt16 <= X <= maxUInt16 ) [macro] rule #rangeUInt ( 48 , X ) => #range ( minUInt48 <= X <= maxUInt48 ) [macro] rule #rangeUInt ( 128 , X ) => #range ( minUInt128 <= X <= maxUInt128 ) [macro] + rule #rangeUInt ( 160 , X ) => #range ( minUInt160 <= X <= maxUInt160 ) [macro] rule #rangeUInt ( 256 , X ) => #range ( minUInt256 <= X <= maxUInt256 ) [macro] rule #rangeSFixed ( 128 , 10 , X ) => #range ( minSFixed128x10 <= X <= maxSFixed128x10 ) [macro] rule #rangeUFixed ( 128 , 10 , X ) => #range ( minUFixed128x10 <= X <= maxUFixed128x10 ) [macro] @@ -411,22 +412,25 @@ A cons-list is used for the EVM wordstack. - `WS [ N := W ]` sets element $N$ of $WS$ to $W$ (padding with zeros as needed). ```k - syntax Int ::= WordStack "[" Int "]" [function] - // ----------------------------------------------- + syntax Int ::= WordStack "[" Int "]" [function, functional] + // ----------------------------------------------------------- rule (W : _):WordStack [ N ] => W requires N ==Int 0 rule WS:WordStack [ N ] => #drop(N, WS) [ 0 ] requires N >Int 0 + rule WS:WordStack [ N ] => 0 requires N W : WS requires N ==Int 0 rule (W0 : WS):WordStack [ N := W ] => W0 : (WS [ N -Int 1 := W ]) requires N >Int 0 + rule WS:WordStack [ N := W ] => WS requires N (0 : .WordStack) [ N := W ] ``` -- Definedness conditions for `WS [ N ]` and `WS [ N := W ]` +- Definedness conditions for `WS [ N ]`: ```{.k .symbolic} - rule #Ceil(WS[N]) => {((0 <=Int N) andBool (N {((0 <=Int N) andBool (N VAL M, KEY )) => {(#Ceil(#lookup( M, KEY )) andBool isInt(VAL)) #Equals true} [anywhere] + rule #Ceil(#lookup( .Map, _ )) => true [anywhere] ``` - `#sizeWordStack` calculates the size of a `WordStack`. @@ -475,12 +479,13 @@ Most of EVM data is held in local memory. ```{.k .membytes} syntax Memory = Bytes - syntax Memory ::= Memory "[" Int ":=" ByteArray "]" [function, klabel(mapWriteBytes)] - // ------------------------------------------------------------------------------------- - rule WS [ START := WS' ] => replaceAtBytes(padRightBytes(WS, START +Int #sizeByteArray(WS'), 0), START, WS') [concrete] + syntax Memory ::= Memory "[" Int ":=" ByteArray "]" [function, functional, klabel(mapWriteBytes)] + // ------------------------------------------------------------------------------------------------- + rule WS [ START := WS' ] => replaceAtBytes(padRightBytes(WS, START +Int #sizeByteArray(WS'), 0), START, WS') requires START >=Int 0 [concrete] + rule WS [ START := WS':ByteArray ] => .Memory requires START LM [ START .. WIDTH ] [concrete] syntax Memory ::= ".Memory" [function] @@ -564,41 +569,45 @@ The local memory of execution is a byte-array (instead of a word-array). // -------------------------------------------------------- rule .ByteArray => .Bytes [macro] - syntax Int ::= #asWord ( ByteArray ) [function, smtlib(asWord)] - // --------------------------------------------------------------- - rule #asWord(WS) => chop(Bytes2Int(WS, BE, Unsigned)) + syntax Int ::= #asWord ( ByteArray ) [function, functional, smtlib(asWord)] + // --------------------------------------------------------------------------- + rule #asWord(WS) => chop(Bytes2Int(WS, BE, Unsigned)) [concrete] - syntax Int ::= #asInteger ( ByteArray ) [function] - // -------------------------------------------------- - rule #asInteger(WS) => Bytes2Int(WS, BE, Unsigned) + syntax Int ::= #asInteger ( ByteArray ) [function, functional] + // -------------------------------------------------------------- + rule #asInteger(WS) => Bytes2Int(WS, BE, Unsigned) [concrete] syntax Account ::= #asAccount ( ByteArray ) [function] // ------------------------------------------------------ rule #asAccount(BS) => .Account requires lengthBytes(BS) ==Int 0 rule #asAccount(BS) => #asWord(BS) [owise] - syntax ByteArray ::= #asByteStack ( Int ) [function] - // ---------------------------------------------------- - rule #asByteStack(W) => Int2Bytes(W, BE, Unsigned) + syntax ByteArray ::= #asByteStack ( Int ) [function, functional] + // ---------------------------------------------------------------- + rule #asByteStack(W) => Int2Bytes(W, BE, Unsigned) [concrete] - syntax ByteArray ::= ByteArray "++" ByteArray [function, right, klabel(_++_WS), smtlib(_plusWS_)] - // ------------------------------------------------------------------------------------------------- - rule WS ++ WS' => WS +Bytes WS' + syntax ByteArray ::= ByteArray "++" ByteArray [function, functional, right, klabel(_++_WS), smtlib(_plusWS_)] + // ------------------------------------------------------------------------------------------------------------- + rule WS ++ WS' => WS +Bytes WS' [concrete] - syntax ByteArray ::= ByteArray "[" Int ".." Int "]" [function] - // -------------------------------------------------------------- - rule WS [ START .. WIDTH ] => substrBytes(padRightBytes(WS, START +Int WIDTH, 0), START, START +Int WIDTH) requires START padRightBytes(.Bytes, WIDTH, 0) [owise] + syntax ByteArray ::= ByteArray "[" Int ".." Int "]" [function, functional] + // -------------------------------------------------------------------------- + rule WS [ START .. WIDTH ] => padRightBytes(.Bytes, WIDTH, 0) [concrete, owise] + rule WS [ START .. WIDTH ] => .ByteArray requires notBool (WIDTH >=Int 0 andBool START >=Int 0) + rule WS [ START .. WIDTH ] => substrBytes(padRightBytes(WS, START +Int WIDTH, 0), START, START +Int WIDTH) + requires WIDTH >=Int 0 andBool START >=Int 0 andBool START lengthBytes(WS) [concrete] - syntax ByteArray ::= #padToWidth ( Int , ByteArray ) [function] - | #padRightToWidth ( Int , ByteArray ) [function] - // -------------------------------------------------------------------- - rule #padToWidth(N, BS) => padLeftBytes(BS, N, 0) - rule #padRightToWidth(N, BS) => padRightBytes(BS, N, 0) + syntax ByteArray ::= #padToWidth ( Int , ByteArray ) [function, functional] + | #padRightToWidth ( Int , ByteArray ) [function, functional] + // -------------------------------------------------------------------------------- + rule #padToWidth(N, BS) => BS requires notBool (N >=Int 0) + rule #padToWidth(N, BS) => padLeftBytes(BS, N, 0) requires N >=Int 0 [concrete] + rule #padRightToWidth(N, BS) => BS requires notBool (N >=Int 0) + rule #padRightToWidth(N, BS) => padRightBytes(BS, N, 0) requires N >=Int 0 [concrete] ``` ```{.k .nobytes} @@ -640,8 +649,8 @@ The local memory of execution is a byte-array (instead of a word-array). // -------------------------------------------------------------------------------- rule WS [ START .. WIDTH ] => #take(WIDTH, #drop(START, WS)) - syntax Int ::= #sizeByteArray ( ByteArray ) [function, functional, memo] - // ------------------------------------------------------------------------ + syntax Int ::= #sizeByteArray ( ByteArray ) [function, functional, smtlib(sizeByteArray), memo] + // ----------------------------------------------------------------------------------------------- rule #sizeByteArray ( WS ) => #sizeWordStack(WS) [concrete] syntax ByteArray ::= #padToWidth ( Int , ByteArray ) [function, functional, memo] @@ -681,8 +690,8 @@ Addresses ```k syntax Int ::= #lookup ( Map , Int ) [function] // ----------------------------------------------- - rule [#lookup.some]: #lookup( (KEY |-> VAL) M, KEY ) => VAL - rule [#lookup.none]: #lookup( M, KEY ) => 0 requires notBool KEY in_keys(M) + rule [#lookup.some]: #lookup( (KEY |-> VAL:Int) M, KEY ) => VAL + rule [#lookup.none]: #lookup( M, KEY ) => 0 requires notBool KEY in_keys(M) ``` ### Substate Log diff --git a/evm.md b/evm.md index 5d10604941..1d4c55140d 100644 --- a/evm.md +++ b/evm.md @@ -46,6 +46,7 @@ In the comments next to each cell, we've marked which component of the YellowPap .ByteArray // H_RETURN .StatusCode + 0 .List .List .Set @@ -256,12 +257,15 @@ Control Flow - `#halt` indicates end of execution. It will consume anything related to the current computation behind it on the `` cell. -- `#end_` sets the `statusCode` then halts execution. +- `#end_` sets the `statusCode` and the program counter of the last executed opcode, then halts execution. ```k syntax KItem ::= "#halt" | "#end" StatusCode // -------------------------------------------- - rule #end SC => #halt ... _ => SC + rule #end SC => #halt ... + _ => SC + _ => PCOUNT + PCOUNT rule #halt ~> (_:Int => .) ... rule #halt ~> (_:OpCode => .) ... @@ -297,7 +301,7 @@ If the program-counter points to an actual opcode, it's loaded into the `#next [ The `#next [_]` operator initiates execution by: 1. checking if there will be a stack over/underflow, or a static mode violation, -2. loading any additional state needed (when executing in full-node mode), +2. calculate any address conversions needed for items on the wordstack, 3. executing the opcode (which includes any gas deduction needed), and 4. adjusting the program counter. @@ -305,7 +309,7 @@ The `#next [_]` operator initiates execution by: syntax InternalOp ::= "#next" "[" OpCode "]" // -------------------------------------------- rule #next [ OP ] - => #load [ OP ] + => #addr [ OP ] ~> #exec [ OP ] ~> #pc [ OP ] ... @@ -420,7 +424,6 @@ The `#next [_]` operator initiates execution by: ``` Here we load the correct number of arguments from the `wordStack` based on the sort of the opcode. -Some of them require an argument to be interpereted as an address (modulo 160 bits), so the `#addr?` function performs that check. ```k syntax KItem ::= OpCode @@ -457,61 +460,35 @@ The `CallOp` opcodes all interperet their second argument as an address. rule #exec [ CO:CallOp ] => #gas [ CO , CO W0 W1 W2 W3 W4 W5 W6 ] ~> CO W0 W1 W2 W3 W4 W5 W6 ... W0 : W1 : W2 : W3 : W4 : W5 : W6 : WS => WS ``` -### Helpers +### Address Conversion -- `#addr` decides if the given argument should be interpreted as an address (given the opcode). +Some opcodes require accessing elements of the state at different addresses. +We make sure the given arguments (to be interpreted as addresses) are with 160 bits ahead of time. ```k - syntax InternalOp ::= "#load" "[" OpCode "]" + syntax InternalOp ::= "#addr" "[" OpCode "]" // -------------------------------------------- - rule #load [ OP:OpCode ] => #loadAccount #addr(W0) ... + rule #addr [ OP:OpCode ] => . ... (W0 => #addr(W0)) : WS - requires #addr?(OP) + requires OP ==K BALANCE + orBool OP ==K SELFDESTRUCT + orBool OP ==K EXTCODEHASH + orBool OP ==K EXTCODESIZE + orBool OP ==K EXTCODECOPY - rule #load [ OP:OpCode ] => #loadAccount #addr(W0) ~> #lookupCode #addr(W0) ... - (W0 => #addr(W0)) : WS - requires #code?(OP) - - rule #load [ OP:OpCode ] => #loadAccount #addr(W1) ~> #lookupCode #addr(W1) ... + rule #addr [ OP:OpCode ] => . ... W0 : (W1 => #addr(W1)) : WS requires isCallOp(OP) orBool isCallSixOp(OP) - rule #load [ CREATE ] => #loadAccount #newAddr(ACCT, NONCE) ... - ACCT - - ACCT - NONCE - ... - - - rule #load [ OP:OpCode ] => #lookupStorage ACCT W0 ... - ACCT - W0 : WS - requires OP ==K SSTORE orBool OP ==K SLOAD - - rule #load [ OP:OpCode ] => . ... - requires notBool ( - OP ==K CREATE orBool - OP ==K SLOAD orBool - OP ==K SSTORE orBool - isCallOp (OP) orBool - isCallSixOp(OP) orBool - #addr?(OP) orBool - #code?(OP) - ) - - syntax Bool ::= "#addr?" "(" OpCode ")" [function] - // -------------------------------------------------- - rule #addr?(BALANCE) => true - rule #addr?(SELFDESTRUCT) => true - rule #addr?(EXTCODEHASH) => true - rule #addr?(OP) => false requires (OP =/=K BALANCE) andBool (OP =/=K SELFDESTRUCT) andBool (OP =/=K EXTCODEHASH) - - syntax Bool ::= "#code?" "(" OpCode ")" [function] - // -------------------------------------------------- - rule #code?(EXTCODESIZE) => true - rule #code?(EXTCODECOPY) => true - rule #code?(OP) => false requires (OP =/=K EXTCODESIZE) andBool (OP =/=K EXTCODECOPY) + rule #addr [ OP:OpCode ] => . ... + requires notBool ( OP ==K BALANCE + orBool OP ==K SELFDESTRUCT + orBool OP ==K EXTCODEHASH + orBool OP ==K EXTCODESIZE + orBool OP ==K EXTCODECOPY + orBool isCallOp(OP) + orBool isCallSixOp(OP) + ) ``` ### Program Counter @@ -644,7 +621,7 @@ After executing a transaction, it's necessary to have the effect of the substate - `#finalizeBlock` is used to signal that block finalization procedures should take place (after transactions have executed). - `#rewardOmmers(_)` pays out the reward to uncle blocks so that blocks are orphaned less often in Ethereum. -```{.k .standalone} +```k syntax EthereumCommand ::= "#startBlock" // ---------------------------------------- rule #startBlock => . ... @@ -790,40 +767,6 @@ These are just used by the other operators for shuffling local execution state a ``` -The following operations help with loading account information from an external running client. -This minimizes the amount of information which must be stored in the configuration. - -- `#loadAccount` queries for account data from the running client. -- `#lookupCode` loads the code of an account into the `` cell. -- `#lookupStorage` loads the value of the specified storage key into the `` cell. - -```k - syntax InternalOp ::= "#loadAccount" Int - | "#lookupCode" Int - | "#lookupStorage" Int Int - // ---------------------------------------------- -``` - -In `standalone` mode, the semantics assumes that all relevant account data is already loaded into memory. - -```{.k .standalone} - rule #loadAccount _ => . ... - rule #lookupCode _ => . ... - rule #lookupStorage _ _ => . ... -``` - -In `node` mode, the semantics are given in terms of an external call to a running client. - -```{.k .node} - rule #lookupStorage ACCT INDEX => . ... - - ACCT - STORAGE:Map - ... - - requires INDEX in_keys(STORAGE) -``` - - `#transferFunds` moves money from one account into another, creating the destination account if it doesn't exist. ```k @@ -1041,7 +984,7 @@ These operators make queries about the current execution state. When running as a `node`, the blockhash will be retrieved from the running client. Otherwise, it is calculated here using the "shortcut" formula used for running tests. -```{.k .standalone} +```k rule BLOCKHASH N => #blockhash(HASHES, N, HI -Int 1, 0) ~> #push ... HI HASHES @@ -1386,7 +1329,7 @@ The various `CALL*` (and other inter-contract control flow) operations will be d _ => .WordStack _ => .Memory - syntax Set ::= #computeValidJumpDests(ByteArray) [function] + syntax Set ::= #computeValidJumpDests(ByteArray) [function, memo] | #computeValidJumpDests(ByteArray, Int, List) [function, klabel(#computeValidJumpDestsAux)] // --------------------------------------------------------------------------------------------------------- rule #computeValidJumpDests(PGM) => #computeValidJumpDests(PGM, 0, .List) @@ -1632,15 +1575,12 @@ For each `CALL*` operation, we make a corresponding call to `#call` and a state- ``` `CREATE2` will attempt to `#create` the account, but with the new scheme for choosing the account address. -Note that we cannot execute #loadAccount during the #load phase earlier because gas will not yet -have been paid, and it may be to expensive to compute the hash of the init code. ```k syntax QuadStackOp ::= "CREATE2" // -------------------------------- rule CREATE2 VALUE MEMSTART MEMWIDTH SALT - => #loadAccount #newAddr(ACCT, SALT, #range(LM, MEMSTART, MEMWIDTH)) - ~> #checkCall ACCT VALUE + => #checkCall ACCT VALUE ~> #create ACCT #newAddr(ACCT, SALT, #range(LM, MEMSTART, MEMWIDTH)) VALUE #range(LM, MEMSTART, MEMWIDTH) ~> #codeDeposit #newAddr(ACCT, SALT, #range(LM, MEMSTART, MEMWIDTH)) ... @@ -2556,8 +2496,8 @@ After interpreting the strings representing programs as a `WordStack`, it should - `#dasmOpCode` interperets a `Int` as an `OpCode`. ```k - syntax OpCode ::= #dasmOpCode ( Int , Schedule ) [function] - // ----------------------------------------------------------- + syntax OpCode ::= #dasmOpCode ( Int , Schedule ) [function, memo] + // ----------------------------------------------------------------- rule #dasmOpCode( 0, _ ) => STOP rule #dasmOpCode( 1, _ ) => ADD rule #dasmOpCode( 2, _ ) => MUL diff --git a/json.md b/json.md index ef4c1b5fcf..907ea4cfe5 100644 --- a/json.md +++ b/json.md @@ -1,7 +1,11 @@ -### JSON Formatting +KJSON +===== -The JSON format is used extensively for communication in the Ethereum circles. -Writing a JSON-ish parser in K takes 6 lines. +This is a non-faithful implementation of the [ECMA-404 JSON Data Interchange Format](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +There are issues with how `JSONNumber` and `JSONString` are specified here, because we use K's `String` and `Int` sort directly, which are not quite correct. + +JSON Syntax +----------- ```k module JSON @@ -12,19 +16,79 @@ module JSON syntax JSONs ::= List{JSON,","} [klabel(JSONs) , symbol] syntax JSONKey ::= String syntax JSON ::= "null" [klabel(JSONnull) , symbol] - | String | Int | Bool + | JSONKey | Bool | JSONKey ":" JSON [klabel(JSONEntry) , symbol] | "{" JSONs "}" [klabel(JSONObject) , symbol] | "[" JSONs "]" [klabel(JSONList) , symbol] // -------------------------------------------------------------------- ``` +```k +endmodule +``` + +JSON Extensions +--------------- + +Some common functions and extensions of JSON are provided here. + +```k +module JSON-EXT + imports JSON +``` + +- `+JSONs` appends two JSON lists. +- `reverseJSONs` reverses a JSON list. + +```k + syntax JSONs ::= JSONs "+JSONs" JSONs [function] + // ------------------------------------------------ + rule .JSONs +JSONs JS' => JS' + rule (J , JS) +JSONs JS' => J , (JS +JSONs JS') + + syntax JSONs ::= reverseJSONs ( JSONs ) [function] + | reverseJSONsAux ( JSONs , JSONs ) [function] + // ------------------------------------------------------------- + rule reverseJSONs(JS) => reverseJSONsAux(JS, .JSONs) + + rule reverseJSONsAux(.JSONs, JS') => JS' + rule reverseJSONsAux((J, JS:JSONs), JS') => reverseJSONsAux(JS, (J, JS')) +``` + +- `qsortJSONs` quick-sorts a list of key-value pairs. +- `sortedJSONs` is a predicate saying whether a given list of JSONs is sorted or not. + +```k + syntax JSONs ::= qsortJSONs ( JSONs ) [function] + | #entriesLT ( String , JSONs ) [function] + | #entriesGE ( String , JSONs ) [function] + // --------------------------------------------------------- + rule qsortJSONs(.JSONs) => .JSONs + rule qsortJSONs(KEY : VALUE, REST) => qsortJSONs(#entriesLT(KEY, REST)) +JSONs (KEY : VALUE , qsortJSONs(#entriesGE(KEY, REST))) + + rule #entriesLT(KEY, .JSONs) => .JSONs + rule #entriesLT(KEY, (KEY': VALUE, REST)) => KEY': VALUE , #entriesLT(KEY, REST) requires KEY' #entriesLT(KEY, REST) requires notBool KEY' .JSONs + rule #entriesGE(KEY, (KEY': VALUE, REST)) => KEY': VALUE , #entriesGE(KEY, REST) requires KEY' >=String KEY + rule #entriesGE(KEY, (KEY': VALUE, REST)) => #entriesGE(KEY, REST) requires notBool KEY' >=String KEY + + syntax Bool ::= sortedJSONs ( JSONs ) [function] + // ------------------------------------------------ + rule sortedJSONs( .JSONs ) => true + rule sortedJSONs( KEY : _ ) => true + rule sortedJSONs( (KEY : _) , (KEY' : VAL) , REST ) => KEY <=String KEY' andThenBool sortedJSONs((KEY' : VAL) , REST) +``` + **TODO**: Adding `Int` to `JSONKey` is a hack to make certain parts of semantics easier. ```k syntax JSONKey ::= Int // ---------------------- +``` +```k endmodule ``` @@ -35,12 +99,12 @@ JSON-RPC module JSON-RPC imports K-IO imports LIST - imports JSON + imports JSON-EXT configuration - $SOCK:Int - 0:IOInt + $INPUT:Int + $OUTPUT:Int "":JSON 0:JSON diff --git a/kevm b/kevm index 613f904579..aea94e9061 100755 --- a/kevm +++ b/kevm @@ -3,13 +3,23 @@ set -euo pipefail shopt -s extglob +notif() { echo "== $@" >&2 ; } +fatal() { echo "[FATAL] $@" ; exit 1 ; } + kevm_dir="${KEVM_DIR:-.}" build_dir="$kevm_dir/.build" defn_dir="${KEVM_DEFN_DIR:-$build_dir/defn}" lib_dir="$build_dir/local/lib" k_release_dir="${K_RELEASE:-$kevm_dir/deps/k/k-distribution/target/release/k}" +if [[ ! -f "${k_release_dir}/bin/kompile" ]]; then + if which kompile &> /dev/null; then + k_release_dir="$(dirname $(which kompile))/.." + else + fatal "Cannot find K Installation!" + fi +fi -export PATH="$k_release_dir/lib/native/linux:$k_release_dir/lib/native/linux64:$k_release_dir/bin/:$PATH" +export PATH="${defn_dir}/web3/build:$k_release_dir/lib/native/linux:$k_release_dir/lib/native/linux64:$k_release_dir/bin/:$PATH" export LD_LIBRARY_PATH="$k_release_dir/lib/native/linux64:$lib_dir:${LD_LIBRARY_PATH:-}" test_logs="$build_dir/logs" @@ -20,28 +30,6 @@ KLAB_OUT="${KLAB_OUT:-$build_dir/klab}" KLAB_NODE_STACK_SIZE="${KLAB_NODE_STACK_SIZE:-30000}" export KLAB_OUT -# Utilities -# --------- - -notif() { echo "== $@" >&2 ; } -fatal() { echo "[FATAL] $@" ; exit 1 ; } - -pretty_diff() { - git --no-pager diff --no-index --ignore-all-space "$@" -} - -get_port() { - python3 -c """ -import socket - -s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) -s.bind(('', 0)) -addr = s.getsockname() -print(str(addr[1])) -s.close() -""" -} - # Runners # ------- @@ -97,27 +85,22 @@ run_search() { } run_web3() { - local web3_port - web3_port="$1" ; shift - kevm_port=$(get_port) run_file='-' if $debug; then - gdb --args ${defn_dir}/web3/build/kevm-client --port "$web3_port" --kport "$kevm_port" "$@" + gdb --args kevm-client --port "$kevm_port" --host "$kevm_host" "$@" elif $dump; then - exec -a "$0 web3" ${defn_dir}/web3/build/kevm-client --dump --port "$web3_port" --kport "$kevm_port" "$@" 3>&2 2>&1 1>&3 \ + exec -a "$0 web3" kevm-client --dump --port "$kevm_port" --host "$kevm_host" "$@" 3>&2 2>&1 1>&3 \ | "$0" kast --backend web3 - pretty --input kore --sort GeneratedTopCell else - exec -a "$0 web3" ${defn_dir}/web3/build/kevm-client --port "$web3_port" --kport "$kevm_port" "$@" 2>/dev/null + exec -a "$0 web3" kevm-client --port "$kevm_port" --host "$kevm_host" "$@" 2>/dev/null fi } run_web3_send() { - local web3_port web3_method web3_params web3_file - web3_port="$1" ; shift - + local web3_method web3_params web3_file if [[ -f "$1" ]]; then web3_file="$1" ; shift - curl -s -X POST 127.0.0.1:$web3_port --data @$web3_file + curl -s -X POST $kevm_host:$kevm_port --data @$web3_file else web3_method="$1" ; shift join_args() { @@ -125,32 +108,10 @@ run_web3_send() { echo "$*" } web3_params="$(join_args "$@")" - curl -s -X POST --data '{"jsonrpc": "2.0", "id": 1, "method": "'"$web3_method"'", "params": ['"$web3_params"']}' 127.0.0.1:"$web3_port" + curl -s -X POST --data '{"jsonrpc": "2.0", "id": 1, "method": "'"$web3_method"'", "params": ['"$web3_params"']}' "$kevm_host":"$kevm_port" fi } -run_web3_ganache() { - local web3_port - web3_port="$1" ; shift - - notif 'Launching web3 client' - $0 web3 "${args[@]}" "$web3_port" "$@" & - while ! netcat -z 127.0.0.1 "$web3_port" ; do sleep 0.1; done - notif 'Generating accounts' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0xdc7e9a7c64933ab893160b79d099c254d274e1c40c6df6d5239e1a623e3d6de1", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0x6e2687f9732d970c6b1d5baa3dff26c4af36257552bc17df737afbc00ca70de2", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0xd34d8e873da77217abaef9424a7d87fce351b603920c7f5288d7701c5f148860", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0x976b5ec9253759d4a2746c37597841beba57527123dc3db2165b637adce58bcb", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0x23dff7ac7981167eb5386e51c3d6d2e3ca9dc219315749b2058d0a2d1e21625e", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0xe040e4bf96d8c9d3a8d1ffb22b30ed4b0a79a25342d656c5a8e2784b0fab752f", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0x13abddd7d94165fc46bed2cad6b0b14cd0267a85f70ad5c26cce82c609e0bf87", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0x0e29f7d6984bb47d60db479212ca56af516705b07d8753b474bd7f0db8bc1921", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0xea7fe1480e9ab71c261c5e1e727f36482f84dbdb07dbf8c8e9f767dcecf87568", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_addAccount '{"key":"0x5f9addbbf41ae2e3d6cb7b07ffabf2c5ff6edc3a38c9dd64a9afd23df02ad7ee", "balance":"0x56BC75E2D63100000"}' - $0 web3-send "$web3_port" firefly_genesisBlock - -} - run_klab() { local run_mode klab_log def_module @@ -240,9 +201,8 @@ if [[ "$run_command" == 'help' ]] || [[ "$run_command" == '--help' ]] ; then $0 kast [--backend (llvm|java|haskell|web3)] * $0 prove [--backend (java|haskell)] * $0 search [--backend (java|haskell)] * - $0 web3 [--debug|--dump] - $0 web3-ganache [--debug|--dump] - $0 web3-send [ |] + $0 web3 [--debug|--dump] [--port ] [--host ] + $0 web3-send [--port ] [--host ] [ |] $0 klab-run * $0 klab-prove * $0 klab-view @@ -256,7 +216,6 @@ if [[ "$run_command" == 'help' ]] || [[ "$run_command" == '--help' ]] ; then $0 search : Search for a K pattern in an EVM program execution $0 web3 : Run version of semantics which understand Web3 RPC (**UNDER CONSTRUCTION**) $0 web3-send : Send message to running Web3 instance of KEVM (**UNDER CONSTRUCTION**) - $0 web3-ganache : Run version of semantics which understand Web3 RPC and is able to communicate with Truffle Test Framework (**UNDER CONSTRUCTION**) $0 klab-(run|prove) : Run program or prove spec and dump StateLogs which KLab can read $0 klab-view : View the statelog associated with a given program or spec @@ -274,6 +233,7 @@ if [[ "$run_command" == 'help' ]] || [[ "$run_command" == '--help' ]] ; then is the specific web3 method to call. is an optional list of parameters to pass to the . specifies a JSON file to feed as input into the web3 server. + is the address of the running Web3 instance. klab-view: Make sure that the 'klab/bin' directory is on your PATH to use this option. " @@ -303,14 +263,15 @@ args=() while [[ $# -gt 0 ]]; do arg="$1" case $arg in - --backend) args+=("$arg" "$2") ; backend="$2" ; shift 2 ;; - --debug) args+=("$arg") ; debug=true ; shift ;; - --dump) args+=("$arg") ; dump=true ; shift ;; - --no-unparse) args+=("$arg") ; unparse=false ; shift ;; - *) break ;; + --backend) args+=("$arg" "$2") ; backend="$2" ; shift 2 ;; + --backend-dir) backend_dir="$2" ; shift 2 ;; + --debug) args+=("$arg") ; debug=true ; shift ;; + --dump) args+=("$arg") ; dump=true ; shift ;; + --no-unparse) args+=("$arg") ; unparse=false ; shift ;; + *) break ;; esac done -backend_dir="$defn_dir/$backend" +backend_dir="${backend_dir:-$defn_dir/$backend}" # get the run file if [[ ! "$run_command" =~ web3* ]]; then @@ -327,6 +288,20 @@ fi cMODE="\`${MODE:-NORMAL}\`(.KList)" cSCHEDULE="\`${SCHEDULE:-ISTANBUL}_EVM\`(.KList)" cCHAINID="${CHAINID:-1}" +kevm_port="8545" +kevm_host="127.0.0.1" + +ARGS=() +while [[ $# -gt 0 ]] ; do + key="$1" + + case $key in + -p|--port) kevm_port="$2" ; shift ; shift ;; + -h|--host|--hostname) kevm_host="$2" ; shift ; shift ;; + *) ARGS+=("$1") ; shift ;; + esac +done +set -- "${ARGS[@]}" case "$run_command-$backend" in @@ -338,7 +313,6 @@ case "$run_command-$backend" in search-@(java|haskell) ) run_search "$@" ;; web3-@(llvm) ) run_web3 "$@" ;; web3-send-@(llvm) ) run_web3_send "$@" ;; - web3-ganache-@(llvm) ) run_web3_ganache "$@" ;; klab-@(run|prove)-java ) run_klab "${run_command#klab-}" "$@" ;; klab-view-java ) view_klab "$@" ;; *) $0 help ; fatal "Unknown command on backend: $run_command $backend" ;; diff --git a/package/Dockerfile.debian-buster b/package/Dockerfile.debian-buster index 9815182396..3b0c10d66d 100644 --- a/package/Dockerfile.debian-buster +++ b/package/Dockerfile.debian-buster @@ -15,13 +15,11 @@ RUN apt-get update \ libcrypto++-dev \ libjemalloc-dev \ libprocps-dev \ - libprotobuf-dev \ libsecp256k1-dev \ libssl-dev \ netcat-openbsd \ pandoc \ pkg-config \ - protobuf-compiler \ sudo RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - diff --git a/package/Dockerfile.ubuntu-bionic b/package/Dockerfile.ubuntu-bionic index 618bdae6f5..ac98ed0f67 100644 --- a/package/Dockerfile.ubuntu-bionic +++ b/package/Dockerfile.ubuntu-bionic @@ -15,13 +15,11 @@ RUN apt-get update \ libcrypto++-dev \ libjemalloc-dev \ libprocps-dev \ - libprotobuf-dev \ libsecp256k1-dev \ libssl-dev \ netcat-openbsd \ pandoc \ pkg-config \ - protobuf-compiler \ sudo RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - diff --git a/package/PKGBUILD b/package/PKGBUILD index f9599a6a80..eabab24463 100644 --- a/package/PKGBUILD +++ b/package/PKGBUILD @@ -8,7 +8,7 @@ arch=('x86_64') url="https://github.com/kframework/evm-semantics" license=('custom') groups=() -depends=('libsecp256k1' 'crypto++' 'protobuf' 'jemalloc') +depends=('libsecp256k1' 'crypto++' 'jemalloc') makedepends=('pandoc' 'kframework-git' 'cmake' 'pkg-config' 'procps-ng' 'fakeroot') checkdepends=() optdepends=() diff --git a/serialization.md b/serialization.md index 6d04cdca3f..77efcdaa58 100644 --- a/serialization.md +++ b/serialization.md @@ -12,7 +12,7 @@ module SERIALIZATION imports KRYPTO imports EVM-TYPES imports STRING-BUFFER - imports JSON + imports JSON-EXT ``` Address/Hash Helpers @@ -21,8 +21,8 @@ Address/Hash Helpers - `keccak` serves as a wrapper around the `Keccak256` in `KRYPTO`. ```k - syntax Int ::= keccak ( ByteArray ) [function, smtlib(smt_keccak)] - // ------------------------------------------------------------------ + syntax Int ::= keccak ( ByteArray ) [function, functional, smtlib(smt_keccak)] + // ------------------------------------------------------------------------------ rule [keccak]: keccak(WS) => #parseHexWord(Keccak256(#unparseByteStack(WS))) ``` @@ -37,12 +37,19 @@ Address/Hash Helpers rule [#newAddr]: #newAddr(ACCT, NONCE) => #addr(#parseHexWord(Keccak256(#rlpEncodeLength(#rlpEncodeBytes(ACCT, 20) +String #rlpEncodeWord(NONCE), 192)))) rule [#newAddrCreate2]: #newAddr(ACCT, SALT, INITCODE) => #addr(#parseHexWord(Keccak256("\xff" +String #unparseByteStack(#padToWidth(20, #asByteStack(ACCT))) +String #unparseByteStack(#padToWidth(32, #asByteStack(SALT))) +String #unparseByteStack(#parseHexBytes(Keccak256(#unparseByteStack(INITCODE))))))) - syntax Account ::= #sender ( Int , Int , Int , Account , Int , String , Int , ByteArray , ByteArray ) [function] - | #sender ( String , Int , String , String ) [function, klabel(#senderAux)] - | #sender ( String ) [function, klabel(#senderAux2)] - // ------------------------------------------------------------------------------------------------------------------------------------- - rule #sender(TN, TP, TG, TT, TV, DATA, TW, TR, TS) - => #sender(#unparseByteStack(#parseHexBytes(Keccak256(#rlpEncodeLength(#rlpEncodeWordStack(TN : TP : TG : .WordStack) +String #rlpEncodeAccount(TT) +String #rlpEncodeWord(TV) +String #rlpEncodeString(DATA), 192)))), TW, #unparseByteStack(TR), #unparseByteStack(TS)) + syntax Account ::= #sender ( Int , Int , Int , Account , Int , String , Int , ByteArray , ByteArray, Int ) [function] + | #sender ( String , Int , String , String ) [function, klabel(#senderAux)] + | #sender ( String ) [function, klabel(#senderAux2)] + // ------------------------------------------------------------------------------------------------------------------------------------------ + rule #sender(TN, TP, TG, TT, TV, DATA, TW, TR, TS, CID) + => #sender(#unparseByteStack(#parseHexBytes(#hashUnsignedTx(TN, TP, TG, TT, TV, #parseByteStackRaw(DATA)))), TW, #unparseByteStack(TR), #unparseByteStack(TS)) + requires TW ==Int 27 orBool TW ==Int 28 + + rule #sender(TN, TP, TG, TT, TV, DATA, TW, TR, TS, CID) + => #sender(#unparseByteStack(#parseHexBytes(#hashUnsignedTx(TN, TP, TG, TT, TV, #parseByteStackRaw(DATA), CID))), 28 -Int (TW %Int 2), #unparseByteStack(TR), #unparseByteStack(TS)) + requires TW ==Int CID *Int 2 +Int 35 orBool TW ==Int CID *Int 2 +Int 36 + + rule #sender(_, _, _, _, _, _, _, _, _, _) => .Account [owise] rule #sender(HT, TW, TR, TS) => #sender(ECDSARecover(HT, TW, TR, TS)) @@ -99,6 +106,7 @@ Address/Hash Helpers ```k syntax String ::= #hashSignedTx ( Int , Int , Int , Account , Int , ByteArray , Int , ByteArray , ByteArray ) [function] | #hashUnsignedTx ( Int , Int , Int , Account , Int , ByteArray ) [function] + | #hashUnsignedTx ( Int , Int , Int , Account , Int , ByteArray, Int ) [function] // -------------------------------------------------------------------------------------------------------------------------- rule [hashTx]: #hashSignedTx(TN, TP, TG, TT, TV, TD, TW, TR, TS) => Keccak256( #rlpEncodeTransaction(TN, TP, TG, TT, TV, TD, TW, TR, TS) ) @@ -113,6 +121,20 @@ Address/Hash Helpers , 192 ) ) + + rule [hashFakeTx2]: #hashUnsignedTx(TN, TP, TG, TT, TV, TD, CID) + => Keccak256( #rlpEncodeLength( #rlpEncodeWord(TN) + +String #rlpEncodeWord(TP) + +String #rlpEncodeWord(TG) + +String #rlpEncodeAccount(TT) + +String #rlpEncodeWord(TV) + +String #rlpEncodeString(#unparseByteStack(TD)) + +String #rlpEncodeWord(CID) + +String #rlpEncodeString("") + +String #rlpEncodeString("") + , 192 + ) + ) ``` The EVM test-sets are represented in JSON format with hex-encoding of the data and programs. diff --git a/state-loader.md b/state-loader.md index b4c5d5561a..ca5fad1e77 100644 --- a/state-loader.md +++ b/state-loader.md @@ -1,7 +1,7 @@ State Manager ------------- -```{.k} +```k requires "evm.k" requires "asm.k" @@ -19,7 +19,7 @@ module STATE-LOADER - `clear` clears all the execution state of the machine. - `clearX` clears the substate `X`, for `TX`, `BLOCK`, and `NETWORK`. -```{.k} +```k syntax EthereumCommand ::= "clear" // ---------------------------------- rule clear => clearTX ~> clearBLOCK ~> clearNETWORK ... @@ -84,7 +84,7 @@ module STATE-LOADER - `mkAcct_` creates an account with the supplied ID (assuming it's already been chopped to 160 bits). -```{.k} +```k syntax EthereumCommand ::= "mkAcct" Int // --------------------------------------- rule mkAcct ACCT => #newAccount ACCT ... @@ -92,7 +92,7 @@ module STATE-LOADER - `load` loads an account or transaction into the world state. -```{.k} +```k syntax EthereumCommand ::= "load" JSON // -------------------------------------- rule load DATA : { .JSONs } => . ... @@ -105,7 +105,7 @@ module STATE-LOADER Here we perform pre-proccesing on account data which allows "pretty" specification of input. -```{.k} +```k rule load "pre" : { (ACCTID:String) : ACCT } => mkAcct #parseAddr(ACCTID) ~> loadAccount #parseAddr(ACCTID) ACCT ... syntax EthereumCommand ::= "loadAccount" Int JSON @@ -127,7 +127,7 @@ Here we perform pre-proccesing on account data which allows "pretty" specificati Here we load the environmental information. -```{.k} +```k rule load "env" : { KEY : ((VAL:String) => #parseWord(VAL)) } ... requires KEY in (SetItem("currentTimestamp") SetItem("currentGasLimit") SetItem("currentNumber") SetItem("currentDifficulty")) rule load "env" : { KEY : ((VAL:String) => #parseHexWord(VAL)) } ... @@ -158,7 +158,7 @@ Here we load the environmental information. The `"network"` key allows setting the fee schedule inside the test. -```{.k} +```k rule load "network" : SCHEDSTRING => . ... _ => #asScheduleString(SCHEDSTRING) @@ -176,7 +176,7 @@ The `"network"` key allows setting the fee schedule inside the test. The `"rlp"` key loads the block information. -```{.k} +```k rule load "rlp" : (VAL:String => #rlpDecode(#unparseByteStack(#parseByteStack(VAL)))) ... rule load "genesisRLP" : (VAL:String => #rlpDecode(#unparseByteStack(#parseByteStack(VAL)))) ... // --------------------------------------------------------------------------------------------------------- @@ -212,9 +212,9 @@ The `"rlp"` key loads the block information. ( .Bag => - TXID:Int - 20000000000 - 90000 + TXID:Int + 20000000000 + 90000 ... ) @@ -267,20 +267,21 @@ The `"rlp"` key loads the block information. ### Block Identifiers -```{.k} +```k syntax BlockIdentifier ::= Int | "LATEST" | "PENDING" | "EARLIEST" // ------------------------------------- - syntax BlockIdentifier ::= #parseBlockIdentifier ( String ) [function] - // ---------------------------------------------------------------------- - rule #parseBlockIdentifier("pending") => PENDING - rule #parseBlockIdentifier("latest") => LATEST - rule #parseBlockIdentifier("earliest") => EARLIEST - rule #parseBlockIdentifier(BLOCKNUM) => #parseHexWord(BLOCKNUM) requires substrString(BLOCKNUM,0,2) ==String "0x" + syntax BlockIdentifier ::= #parseBlockIdentifier ( JSON ) [function] + // -------------------------------------------------------------------- + rule #parseBlockIdentifier(BLOCKNUM:Int) => BLOCKNUM + rule #parseBlockIdentifier("pending") => PENDING + rule #parseBlockIdentifier("latest") => LATEST + rule #parseBlockIdentifier("earliest") => EARLIEST + rule #parseBlockIdentifier(BLOCKNUM) => #parseWord(BLOCKNUM) [owise] ``` -```{.k} +```k endmodule ``` diff --git a/tests/failing.web3 b/tests/failing.web3 index e69de29bb2..93d269e9e7 100644 --- a/tests/failing.web3 +++ b/tests/failing.web3 @@ -0,0 +1 @@ +tests/web3/evm_increaseTime_fail.in.json diff --git a/tests/failing/ContractCreationSpam_d0g0v0.json.expected b/tests/failing/ContractCreationSpam_d0g0v0.json.expected index 75cfe340f7..26169cc319 100644 --- a/tests/failing/ContractCreationSpam_d0g0v0.json.expected +++ b/tests/failing/ContractCreationSpam_d0g0v0.json.expected @@ -19,6 +19,9 @@ EVMC_OUT_OF_GAS + + 820 + .List diff --git a/tests/failing/static_callcodecallcodecall_110_OOGMAfter_2_d0g0v0.json.expected b/tests/failing/static_callcodecallcodecall_110_OOGMAfter_2_d0g0v0.json.expected index 738bf6980f..f153ba2ada 100644 --- a/tests/failing/static_callcodecallcodecall_110_OOGMAfter_2_d0g0v0.json.expected +++ b/tests/failing/static_callcodecallcodecall_110_OOGMAfter_2_d0g0v0.json.expected @@ -19,6 +19,9 @@ EVMC_SUCCESS + + 40 + .List diff --git a/tests/interactive/search/branching-invalid.evm.search-expected b/tests/interactive/search/branching-invalid.evm.search-expected index 0761927ddb..e663cb04e1 100644 --- a/tests/interactive/search/branching-invalid.evm.search-expected +++ b/tests/interactive/search/branching-invalid.evm.search-expected @@ -1,240 +1 @@ - { - DotVar0 - #Equals - - 0 - - } -#And - { - DotVar2 - #Equals - - - 1 - - - .Set - - - .AccountCellMap - - - .List - - - .List - - - .MessageCellMap - - - } -#And - { - _0 - #Equals - - b"" - - } -#And - { - _1 - #Equals - - .List - - } -#And - { - _2 - #Equals - - .List - - } -#And - { - _3 - #Equals - - .Set - - } -#And - { - _4 - #Equals - - - b"6003600401600814600c57fe5b00" - - - SetItem ( 12 ) - - - .Account - - - .Account - - - b"" - - - 0 - - - .WordStack - - - b"" - - - 11 - - - 9972 - - - 0 - - - 0 - - - false - - - 0 - - - } -#And - { - _5 - #Equals - - - .Set - - - .List - - - 0 - - - } -#And - { - _6 - #Equals - - 0 - - } -#And - { - _7 - #Equals - - .Account - - } -#And - { - _8 - #Equals - - .List - - } -#And - { - _9 - #Equals - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - b"" - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - b"" - - - 0 - - - 0 - - - [ .JSONs ] - - - } -#And - { - _10 - #Equals - - #halt - - } -#And - { - _11 - #Equals - - 1 - - } -#And - { - _12 - #Equals - - NORMAL - - } -#And - { - _13 - #Equals - - ISTANBUL - - } +#True diff --git a/tests/interactive/search/straight-line.evm.search-expected b/tests/interactive/search/straight-line.evm.search-expected index 83c905d2ec..e663cb04e1 100644 --- a/tests/interactive/search/straight-line.evm.search-expected +++ b/tests/interactive/search/straight-line.evm.search-expected @@ -1,240 +1 @@ - { - DotVar0 - #Equals - - 0 - - } -#And - { - DotVar2 - #Equals - - - 1 - - - .Set - - - .AccountCellMap - - - .List - - - .List - - - .MessageCellMap - - - } -#And - { - _0 - #Equals - - b"" - - } -#And - { - _1 - #Equals - - .List - - } -#And - { - _2 - #Equals - - .List - - } -#And - { - _3 - #Equals - - .Set - - } -#And - { - _4 - #Equals - - - b"7f00000000000000000000000000000000000000000000000000000000000000037f000000000000000000000000000000000000000000000000000000000000000401fe" - - - .Set - - - .Account - - - .Account - - - b"" - - - 0 - - - 7 : .WordStack - - - b"" - - - 67 - - - 9991 - - - 0 - - - 0 - - - false - - - 0 - - - } -#And - { - _5 - #Equals - - - .Set - - - .List - - - 0 - - - } -#And - { - _6 - #Equals - - 0 - - } -#And - { - _7 - #Equals - - .Account - - } -#And - { - _8 - #Equals - - .List - - } -#And - { - _9 - #Equals - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - b"" - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - b"" - - - 0 - - - 0 - - - [ .JSONs ] - - - } -#And - { - _10 - #Equals - - #halt - - } -#And - { - _11 - #Equals - - 1 - - } -#And - { - _12 - #Equals - - NORMAL - - } -#And - { - _13 - #Equals - - ISTANBUL - - } +#True diff --git a/tests/slow.haskell b/tests/slow.haskell index 45a40a4635..22a7a3647e 100644 --- a/tests/slow.haskell +++ b/tests/slow.haskell @@ -1,7 +1,5 @@ -tests/ethereum-tests/VMTests/vmArithmeticTest/add0.json tests/ethereum-tests/VMTests/vmArithmeticTest/add3.json tests/ethereum-tests/VMTests/vmArithmeticTest/add4.json -tests/ethereum-tests/VMTests/vmArithmeticTest/addmod0.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmod1.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmod1_overflow2.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmod1_overflow3.json @@ -12,25 +10,12 @@ tests/ethereum-tests/VMTests/vmArithmeticTest/addmod2_1.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmod2.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmod3_0.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmod3.json -tests/ethereum-tests/VMTests/vmArithmeticTest/addmodBigIntCast.json -tests/ethereum-tests/VMTests/vmArithmeticTest/addmodDivByZero1.json -tests/ethereum-tests/VMTests/vmArithmeticTest/addmodDivByZero2.json tests/ethereum-tests/VMTests/vmArithmeticTest/addmodDivByZero3.json -tests/ethereum-tests/VMTests/vmArithmeticTest/addmodDivByZero.json tests/ethereum-tests/VMTests/vmArithmeticTest/arith1.json tests/ethereum-tests/VMTests/vmArithmeticTest/div1.json -tests/ethereum-tests/VMTests/vmArithmeticTest/divBoostBug.json tests/ethereum-tests/VMTests/vmArithmeticTest/divByNonZero0.json tests/ethereum-tests/VMTests/vmArithmeticTest/divByNonZero1.json -tests/ethereum-tests/VMTests/vmArithmeticTest/divByNonZero3.json tests/ethereum-tests/VMTests/vmArithmeticTest/divByZero_2.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp1.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp2.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp3.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp4.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp5.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp6.json -tests/ethereum-tests/VMTests/vmArithmeticTest/exp7.json tests/ethereum-tests/VMTests/vmArithmeticTest/expPowerOf2_128.json tests/ethereum-tests/VMTests/vmArithmeticTest/expPowerOf2_16.json tests/ethereum-tests/VMTests/vmArithmeticTest/expPowerOf2_256.json @@ -109,19 +94,12 @@ tests/ethereum-tests/VMTests/vmArithmeticTest/expPowerOf2_8.json tests/ethereum-tests/VMTests/vmArithmeticTest/expXY.json tests/ethereum-tests/VMTests/vmArithmeticTest/expXY_success.json tests/ethereum-tests/VMTests/vmArithmeticTest/fibbonacci_unrolled.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mod0.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mod3.json tests/ethereum-tests/VMTests/vmArithmeticTest/mod4.json tests/ethereum-tests/VMTests/vmArithmeticTest/modByZero.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mul3.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mul4.json tests/ethereum-tests/VMTests/vmArithmeticTest/mul5.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mul6.json tests/ethereum-tests/VMTests/vmArithmeticTest/mul7.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod0.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod1.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod1_overflow2.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod1_overflow3.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod1_overflow4.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod1_overflow.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod2_0.json @@ -130,10 +108,8 @@ tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod2.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod3_0.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod3.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmod4.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mulmoddivByZero1.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmoddivByZero2.json tests/ethereum-tests/VMTests/vmArithmeticTest/mulmoddivByZero3.json -tests/ethereum-tests/VMTests/vmArithmeticTest/mulmoddivByZero.json tests/ethereum-tests/VMTests/vmArithmeticTest/not1.json tests/ethereum-tests/VMTests/vmArithmeticTest/sdiv0.json tests/ethereum-tests/VMTests/vmArithmeticTest/sdiv1.json @@ -152,18 +128,11 @@ tests/ethereum-tests/VMTests/vmArithmeticTest/sdiv_dejavu.json tests/ethereum-tests/VMTests/vmArithmeticTest/sdiv_i256min2.json tests/ethereum-tests/VMTests/vmArithmeticTest/sdiv_i256min3.json tests/ethereum-tests/VMTests/vmArithmeticTest/sdiv_i256min.json -tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_00.json -tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_0_BigByte.json -tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_AlmostBiggestByte.json tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_BigByteBigByte.json -tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_BigBytePlus1_2.json -tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_bigBytePlus1.json -tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_bitIsSet.json tests/ethereum-tests/VMTests/vmArithmeticTest/signextend_Overflow_dj42.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod0.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod1.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod2.json -tests/ethereum-tests/VMTests/vmArithmeticTest/smod3.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod4.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod5.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod6.json @@ -171,12 +140,6 @@ tests/ethereum-tests/VMTests/vmArithmeticTest/smod7.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod8_byZero.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod_i256min1.json tests/ethereum-tests/VMTests/vmArithmeticTest/smod_i256min2.json -tests/ethereum-tests/VMTests/vmArithmeticTest/sub0.json -tests/ethereum-tests/VMTests/vmArithmeticTest/sub2.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/and0.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/and2.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/and4.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/and5.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/byte0.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/byte10.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/byte1.json @@ -190,34 +153,17 @@ tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/byte8.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/byte9.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/byteBN.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/eq0.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/eq2.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/gt0.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/gt1.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/gt2.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/gt3.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/iszeo2.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/lt0.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/lt1.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/not3.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/not4.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/not5.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/or1.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/or3.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/or4.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/sgt0.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/sgt1.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/sgt3.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/sgt4.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/slt0.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/slt1.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/slt2.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/slt3.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/slt4.json tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/xor0.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/xor1.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/xor3.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/xor4.json -tests/ethereum-tests/VMTests/vmBitwiseLogicOperation/xor5.json tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldatacopy0.json tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldatacopy0_return.json tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldatacopy1.json @@ -268,7 +214,6 @@ tests/ethereum-tests/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJumpiAfte tests/ethereum-tests/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/jump0_jumpdest0.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/jump0_jumpdest2.json -tests/ethereum-tests/VMTests/vmIOandFlowOperations/jumpAfterStop.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/jumpdestBigList.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/jumpDynamicJumpSameDest.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/jumpi1.json @@ -280,7 +225,6 @@ tests/ethereum-tests/VMTests/vmIOandFlowOperations/loop_stacklimit_1021.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/memory1.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/mloadError1.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/msize0.json -tests/ethereum-tests/VMTests/vmIOandFlowOperations/msize1.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/msize2.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/msize3.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/mstore0.json @@ -290,7 +234,6 @@ tests/ethereum-tests/VMTests/vmIOandFlowOperations/mstore8_1.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/mstore8WordToBigError.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/mstore_mload0.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/mstoreWordToBigError.json -tests/ethereum-tests/VMTests/vmIOandFlowOperations/pc1.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/pop0.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/return2.json tests/ethereum-tests/VMTests/vmIOandFlowOperations/sstore_load_0.json @@ -365,7 +308,6 @@ tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup13.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup14.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup15.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup16.json -tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup3.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup4.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup5.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/dup6.json @@ -380,8 +322,6 @@ tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap13.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap14.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap15.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap16.json -tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap2.json -tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap3.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap4.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap5.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap6.json @@ -389,15 +329,8 @@ tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap7.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap8.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swap9.json tests/ethereum-tests/VMTests/vmPushDupSwapTest/swapjump1.json -tests/ethereum-tests/VMTests/vmSha3Test/sha3_0.json -tests/ethereum-tests/VMTests/vmSha3Test/sha3_1.json tests/ethereum-tests/VMTests/vmSha3Test/sha3_memSizeNoQuadraticCost31.json -tests/ethereum-tests/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32.json -tests/ethereum-tests/VMTests/vmSha3Test/sha3_memSizeQuadraticCost32_zeroSize.json -tests/ethereum-tests/VMTests/vmSha3Test/sha3_memSizeQuadraticCost63.json -tests/ethereum-tests/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64.json tests/ethereum-tests/VMTests/vmSystemOperations/return0.json tests/ethereum-tests/VMTests/vmSystemOperations/return1.json tests/ethereum-tests/VMTests/vmSystemOperations/return2.json -tests/ethereum-tests/VMTests/vmSystemOperations/suicideNotExistingAccount.json tests/ethereum-tests/VMTests/vmSystemOperations/TestNameRegistrator.json diff --git a/tests/slow.java b/tests/slow.java index 3f8a29715c..7455fb3d65 100644 --- a/tests/slow.java +++ b/tests/slow.java @@ -1,4 +1,23 @@ +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/address0.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/address1.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlow.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldataload2.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHighPartial.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/calldatasize1.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/caller.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/callvalue.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/codecopyZeroMemExpansion.json +tests/ethereum-tests/VMTests/vmEnvironmentalInfo/gasprice.json +tests/ethereum-tests/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGas.json +tests/ethereum-tests/VMTests/vmIOandFlowOperations/DynamicJump0_foreverOutOfGas.json +tests/ethereum-tests/VMTests/vmIOandFlowOperations/JDfromStorageDynamicJump0_foreverOutOfGas.json +tests/ethereum-tests/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json +tests/ethereum-tests/VMTests/vmIOandFlowOperations/loop_stacklimit_1020.json +tests/ethereum-tests/VMTests/vmIOandFlowOperations/loop_stacklimit_1021.json +tests/ethereum-tests/VMTests/vmPerformance/ackermann31.json +tests/ethereum-tests/VMTests/vmPerformance/ackermann32.json tests/ethereum-tests/VMTests/vmPerformance/ackermann33.json +tests/ethereum-tests/VMTests/vmPerformance/fibonacci10.json tests/ethereum-tests/VMTests/vmPerformance/fibonacci16.json tests/ethereum-tests/VMTests/vmPerformance/loop-add-10M.json tests/ethereum-tests/VMTests/vmPerformance/loop-divadd-10M.json @@ -12,3 +31,11 @@ tests/ethereum-tests/VMTests/vmPerformance/loop-exp-nop-1M.json tests/ethereum-tests/VMTests/vmPerformance/loop-mul.json tests/ethereum-tests/VMTests/vmPerformance/loop-mulmod-2M.json +tests/ethereum-tests/VMTests/vmPerformance/manyFunctions100.json +tests/ethereum-tests/VMTests/vmSha3Test/sha3_memSizeQuadraticCost64.json +tests/ethereum-tests/VMTests/vmSystemOperations/return1.json +tests/ethereum-tests/VMTests/vmSystemOperations/return2.json +tests/ethereum-tests/VMTests/vmSystemOperations/suicide0.json +tests/ethereum-tests/VMTests/vmSystemOperations/suicideNotExistingAccount.json +tests/ethereum-tests/VMTests/vmSystemOperations/suicideSendEtherToMe.json +tests/ethereum-tests/VMTests/vmSystemOperations/TestNameRegistrator.json diff --git a/tests/specs/benchmarks/address00-spec.k b/tests/specs/benchmarks/address00-spec.k index 16179a5855..9ef0243f77 100644 --- a/tests/specs/benchmarks/address00-spec.k +++ b/tests/specs/benchmarks/address00-spec.k @@ -16,6 +16,7 @@ module ADDRESS00-SPEC _ => #encodeArgs(#address(A0)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/bytes00-spec.k b/tests/specs/benchmarks/bytes00-spec.k index 9f3d672479..700722d632 100644 --- a/tests/specs/benchmarks/bytes00-spec.k +++ b/tests/specs/benchmarks/bytes00-spec.k @@ -16,6 +16,7 @@ module BYTES00-SPEC _ => #encodeArgs(#uint256(DATA_LEN)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrec-symbolic.k b/tests/specs/benchmarks/ecrec-symbolic.k index c48aedf756..0daa95e2cf 100644 --- a/tests/specs/benchmarks/ecrec-symbolic.k +++ b/tests/specs/benchmarks/ecrec-symbolic.k @@ -1,8 +1,8 @@ -requires "edsl.k" +requires "evm-symbolic.k" module ECREC-SYMBOLIC [symbolic] - imports EVM - imports EDSL + imports EVM-SYMBOLIC + imports K-REFLECTION // ######################## // ECRECOVER diff --git a/tests/specs/benchmarks/ecrecover00-siginvalid-spec.k b/tests/specs/benchmarks/ecrecover00-siginvalid-spec.k index 9431b7b3be..bb0e25b938 100644 --- a/tests/specs/benchmarks/ecrecover00-siginvalid-spec.k +++ b/tests/specs/benchmarks/ecrecover00-siginvalid-spec.k @@ -16,6 +16,7 @@ module ECRECOVER00-SIGINVALID-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecover00-sigvalid-spec.k b/tests/specs/benchmarks/ecrecover00-sigvalid-spec.k index b1d8dda57d..be59a3d651 100644 --- a/tests/specs/benchmarks/ecrecover00-sigvalid-spec.k +++ b/tests/specs/benchmarks/ecrecover00-sigvalid-spec.k @@ -16,6 +16,7 @@ module ECRECOVER00-SIGVALID-SPEC _ => #encodeArgs(#address(RECOVERED)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecoverloop00-sig0-invalid-spec.k b/tests/specs/benchmarks/ecrecoverloop00-sig0-invalid-spec.k index a633c08fb1..c36e8925ca 100644 --- a/tests/specs/benchmarks/ecrecoverloop00-sig0-invalid-spec.k +++ b/tests/specs/benchmarks/ecrecoverloop00-sig0-invalid-spec.k @@ -16,6 +16,7 @@ module ECRECOVERLOOP00-SIG0-INVALID-SPEC _ => .WordStack _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecoverloop00-sig1-invalid-spec.k b/tests/specs/benchmarks/ecrecoverloop00-sig1-invalid-spec.k index c7cfae0dd1..5c7e104648 100644 --- a/tests/specs/benchmarks/ecrecoverloop00-sig1-invalid-spec.k +++ b/tests/specs/benchmarks/ecrecoverloop00-sig1-invalid-spec.k @@ -16,6 +16,7 @@ module ECRECOVERLOOP00-SIG1-INVALID-SPEC _ => .WordStack _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecoverloop00-sigs-valid-spec.k b/tests/specs/benchmarks/ecrecoverloop00-sigs-valid-spec.k index 3a4fbaf105..7f67665c35 100644 --- a/tests/specs/benchmarks/ecrecoverloop00-sigs-valid-spec.k +++ b/tests/specs/benchmarks/ecrecoverloop00-sigs-valid-spec.k @@ -16,6 +16,7 @@ module ECRECOVERLOOP00-SIGS-VALID-SPEC _ => .WordStack _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecoverloop02-sig0-invalid-spec.k b/tests/specs/benchmarks/ecrecoverloop02-sig0-invalid-spec.k index a7e7951a45..fd5704df45 100644 --- a/tests/specs/benchmarks/ecrecoverloop02-sig0-invalid-spec.k +++ b/tests/specs/benchmarks/ecrecoverloop02-sig0-invalid-spec.k @@ -16,6 +16,7 @@ module ECRECOVERLOOP02-SIG0-INVALID-SPEC _ => .WordStack _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecoverloop02-sig1-invalid-spec.k b/tests/specs/benchmarks/ecrecoverloop02-sig1-invalid-spec.k index b85e30f8ab..734a498c52 100644 --- a/tests/specs/benchmarks/ecrecoverloop02-sig1-invalid-spec.k +++ b/tests/specs/benchmarks/ecrecoverloop02-sig1-invalid-spec.k @@ -16,6 +16,7 @@ module ECRECOVERLOOP02-SIG1-INVALID-SPEC _ => .WordStack _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/ecrecoverloop02-sigs-valid-spec.k b/tests/specs/benchmarks/ecrecoverloop02-sigs-valid-spec.k index 1db175dde7..55224a67c7 100644 --- a/tests/specs/benchmarks/ecrecoverloop02-sigs-valid-spec.k +++ b/tests/specs/benchmarks/ecrecoverloop02-sigs-valid-spec.k @@ -16,6 +16,7 @@ module ECRECOVERLOOP02-SIGS-VALID-SPEC _ => .WordStack _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/encode_keccak00-spec.k b/tests/specs/benchmarks/encode_keccak00-spec.k index 61f713c9c9..e248baf06a 100644 --- a/tests/specs/benchmarks/encode_keccak00-spec.k +++ b/tests/specs/benchmarks/encode_keccak00-spec.k @@ -16,6 +16,7 @@ module ENCODE_KECCAK00-SPEC _ => #encodeArgs(#bytes32(keccak(#encodeArgs(#bytes32(A0), #bytes32(A1))))) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/encodepacked_keccak01-spec.k b/tests/specs/benchmarks/encodepacked_keccak01-spec.k index 1d98116a49..b659959597 100644 --- a/tests/specs/benchmarks/encodepacked_keccak01-spec.k +++ b/tests/specs/benchmarks/encodepacked_keccak01-spec.k @@ -16,6 +16,7 @@ module ENCODEPACKED_KECCAK01-SPEC _ => #encodeArgs(#bytes32(keccak(1 : #encodeArgs(#uint256(A0))))) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/evm-data-map-symbolic.k b/tests/specs/benchmarks/evm-data-map-symbolic.k index 8a48c9c339..2937479ff6 100644 --- a/tests/specs/benchmarks/evm-data-map-symbolic.k +++ b/tests/specs/benchmarks/evm-data-map-symbolic.k @@ -2,7 +2,6 @@ requires "edsl.k" module EVM-DATA-MAP-SYMBOLIC [symbolic] imports K-REFLECTION - imports EVM-DATA imports EDSL rule ( WS1 ++ WS2 ) ++ WS3 => WS1 ++ ( WS2 ++ WS3 ) diff --git a/tests/specs/benchmarks/keccak00-spec.k b/tests/specs/benchmarks/keccak00-spec.k index e94f84a8e6..ac274cf97f 100644 --- a/tests/specs/benchmarks/keccak00-spec.k +++ b/tests/specs/benchmarks/keccak00-spec.k @@ -16,6 +16,7 @@ module KECCAK00-SPEC _ => #encodeArgs(#bytes32(keccak(#buf(DATA_LEN, DATA)))) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/overflow00-nooverflow-spec.k b/tests/specs/benchmarks/overflow00-nooverflow-spec.k index 21360adb94..b682ea04b7 100644 --- a/tests/specs/benchmarks/overflow00-nooverflow-spec.k +++ b/tests/specs/benchmarks/overflow00-nooverflow-spec.k @@ -16,6 +16,7 @@ module OVERFLOW00-NOOVERFLOW-SPEC _ => #encodeArgs(#uint256(N)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/overflow00-overflow-spec.k b/tests/specs/benchmarks/overflow00-overflow-spec.k index 99e633b963..6fb65f0197 100644 --- a/tests/specs/benchmarks/overflow00-overflow-spec.k +++ b/tests/specs/benchmarks/overflow00-overflow-spec.k @@ -16,6 +16,7 @@ module OVERFLOW00-OVERFLOW-SPEC _ => #encodeArgs(#uint256(N)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/requires01-a0gt0-spec.k b/tests/specs/benchmarks/requires01-a0gt0-spec.k index 49a1b97359..da67cba4ee 100644 --- a/tests/specs/benchmarks/requires01-a0gt0-spec.k +++ b/tests/specs/benchmarks/requires01-a0gt0-spec.k @@ -16,6 +16,7 @@ module REQUIRES01-A0GT0-SPEC _ => #encodeArgs(#uint256(5)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/requires01-a0le0-spec.k b/tests/specs/benchmarks/requires01-a0le0-spec.k index bd21650c8a..dddb0badac 100644 --- a/tests/specs/benchmarks/requires01-a0le0-spec.k +++ b/tests/specs/benchmarks/requires01-a0le0-spec.k @@ -16,6 +16,7 @@ module REQUIRES01-A0LE0-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/staticarray00-spec.k b/tests/specs/benchmarks/staticarray00-spec.k index cc900ae9ba..4ca2efccb5 100644 --- a/tests/specs/benchmarks/staticarray00-spec.k +++ b/tests/specs/benchmarks/staticarray00-spec.k @@ -16,6 +16,7 @@ module STATICARRAY00-SPEC _ => #encodeArgs(#uint256(A0)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/staticloop00-a0lt10-spec.k b/tests/specs/benchmarks/staticloop00-a0lt10-spec.k index 582b8f4866..e414c29d6a 100644 --- a/tests/specs/benchmarks/staticloop00-a0lt10-spec.k +++ b/tests/specs/benchmarks/staticloop00-a0lt10-spec.k @@ -16,6 +16,7 @@ module STATICLOOP00-A0LT10-SPEC _ => #encodeArgs(#uint256(A0 +Int 3)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/storagevar00-spec.k b/tests/specs/benchmarks/storagevar00-spec.k index c69a836282..b6daa806d9 100644 --- a/tests/specs/benchmarks/storagevar00-spec.k +++ b/tests/specs/benchmarks/storagevar00-spec.k @@ -16,6 +16,7 @@ module STORAGEVAR00-SPEC _ => #encodeArgs(#uint256(N)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/storagevar01-spec.k b/tests/specs/benchmarks/storagevar01-spec.k index 3b9c50ad40..328f2e0b41 100644 --- a/tests/specs/benchmarks/storagevar01-spec.k +++ b/tests/specs/benchmarks/storagevar01-spec.k @@ -16,6 +16,7 @@ module STORAGEVAR01-SPEC _ => #encodeArgs(#uint256(N1)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/storagevar02-nooverflow-spec.k b/tests/specs/benchmarks/storagevar02-nooverflow-spec.k index 9166ea0bd9..7c0b925034 100644 --- a/tests/specs/benchmarks/storagevar02-nooverflow-spec.k +++ b/tests/specs/benchmarks/storagevar02-nooverflow-spec.k @@ -16,6 +16,7 @@ module STORAGEVAR02-NOOVERFLOW-SPEC _ => #encodeArgs(#uint256(N1)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/storagevar02-overflow-spec.k b/tests/specs/benchmarks/storagevar02-overflow-spec.k index b1a9bb5ce6..ceb3b15513 100644 --- a/tests/specs/benchmarks/storagevar02-overflow-spec.k +++ b/tests/specs/benchmarks/storagevar02-overflow-spec.k @@ -16,6 +16,7 @@ module STORAGEVAR02-OVERFLOW-SPEC _ => #encodeArgs(#uint256(N1)) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/storagevar03-spec.k b/tests/specs/benchmarks/storagevar03-spec.k index 2f68175da1..caf990c325 100644 --- a/tests/specs/benchmarks/storagevar03-spec.k +++ b/tests/specs/benchmarks/storagevar03-spec.k @@ -16,6 +16,7 @@ module STORAGEVAR03-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ _ _ => _ diff --git a/tests/specs/benchmarks/verification.k b/tests/specs/benchmarks/verification.k index 382f25401c..06095e4551 100644 --- a/tests/specs/benchmarks/verification.k +++ b/tests/specs/benchmarks/verification.k @@ -1,13 +1,11 @@ requires "evm-symbolic.k" requires "evm-data-map-symbolic.k" -requires "edsl.k" requires "edsl-static-array.k" requires "../lemmas.k" module VERIFICATION imports EVM-SYMBOLIC imports EVM-DATA-MAP-SYMBOLIC - imports EDSL imports EDSL-STATIC-ARRAY imports LEMMAS diff --git a/tests/specs/bihu/collectToken-spec.k b/tests/specs/bihu/collectToken-spec.k index aa94db6ddc..d430c8d989 100644 --- a/tests/specs/bihu/collectToken-spec.k +++ b/tests/specs/bihu/collectToken-spec.k @@ -15,6 +15,7 @@ module COLLECTTOKEN-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ => _ _ _ => _ @@ -127,6 +128,7 @@ ensures VALUE ==Int @canExtractThisYear(COLLECTED +Int BAL, NOW, START) +Int BAL _ _ + _ => ?_ _ => _ _ _ => _ @@ -230,6 +232,7 @@ andBool GASCAP >=Int ((293 *Int (YEARCOUNT -Int INDEX)) +Int 26) _ _ + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/bihu/forwardToHotWallet-failure-1-spec.k b/tests/specs/bihu/forwardToHotWallet-failure-1-spec.k index be7782e3c4..a0e247c340 100644 --- a/tests/specs/bihu/forwardToHotWallet-failure-1-spec.k +++ b/tests/specs/bihu/forwardToHotWallet-failure-1-spec.k @@ -15,6 +15,7 @@ module FORWARDTOHOTWALLET-FAILURE-1-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/bihu/forwardToHotWallet-failure-2-spec.k b/tests/specs/bihu/forwardToHotWallet-failure-2-spec.k index e83e21d3ca..b352dfa655 100644 --- a/tests/specs/bihu/forwardToHotWallet-failure-2-spec.k +++ b/tests/specs/bihu/forwardToHotWallet-failure-2-spec.k @@ -15,6 +15,7 @@ module FORWARDTOHOTWALLET-FAILURE-2-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/bihu/forwardToHotWallet-failure-3-spec.k b/tests/specs/bihu/forwardToHotWallet-failure-3-spec.k index 45e3fdcaae..44f55e6384 100644 --- a/tests/specs/bihu/forwardToHotWallet-failure-3-spec.k +++ b/tests/specs/bihu/forwardToHotWallet-failure-3-spec.k @@ -15,6 +15,7 @@ module FORWARDTOHOTWALLET-FAILURE-3-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/bihu/forwardToHotWallet-failure-4-spec.k b/tests/specs/bihu/forwardToHotWallet-failure-4-spec.k index 23833c3159..bee3a61392 100644 --- a/tests/specs/bihu/forwardToHotWallet-failure-4-spec.k +++ b/tests/specs/bihu/forwardToHotWallet-failure-4-spec.k @@ -15,6 +15,7 @@ module FORWARDTOHOTWALLET-FAILURE-4-SPEC _ => _ _ => EVMC_REVERT + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/bihu/forwardToHotWallet-success-1-spec.k b/tests/specs/bihu/forwardToHotWallet-success-1-spec.k index 8b1ccb601c..beacc7b2c9 100644 --- a/tests/specs/bihu/forwardToHotWallet-success-1-spec.k +++ b/tests/specs/bihu/forwardToHotWallet-success-1-spec.k @@ -15,6 +15,7 @@ module FORWARDTOHOTWALLET-SUCCESS-1-SPEC _ => #buf(32, RET_VAL) _ => EVMC_SUCCESS + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/bihu/forwardToHotWallet-success-2-spec.k b/tests/specs/bihu/forwardToHotWallet-success-2-spec.k index b1dfd2f898..fbd4d4bc38 100644 --- a/tests/specs/bihu/forwardToHotWallet-success-2-spec.k +++ b/tests/specs/bihu/forwardToHotWallet-success-2-spec.k @@ -15,6 +15,7 @@ module FORWARDTOHOTWALLET-SUCCESS-2-SPEC _ => #buf(32, RET_VAL) _ => EVMC_SUCCESS + _ => ?_ _ => _ _ _ => _ diff --git a/tests/specs/erc20/abstract-semantics-segmented-gas.k b/tests/specs/erc20/abstract-semantics-segmented-gas.k index 6bed50b1fe..8e51d3a730 100644 --- a/tests/specs/erc20/abstract-semantics-segmented-gas.k +++ b/tests/specs/erc20/abstract-semantics-segmented-gas.k @@ -1,10 +1,8 @@ requires "evm-symbolic.k" -requires "../lemmas.k" module ABSTRACT-SEMANTICS-SEGMENTED-GAS imports EVM imports EVM-SYMBOLIC - imports LEMMAS // to avoid unnecessary case analyses rule LT W0 W1 => bool2Word(W0 #push ... [trusted] @@ -27,4 +25,5 @@ module ABSTRACT-SEMANTICS-SEGMENTED-GAS #gas(INITGAS, NONMEM, MEM) => #gas(INITGAS, NONMEM +Int G, MEM) _ => #gas(INITGAS, NONMEM, MEM) [trusted, matching(#gas)] + endmodule diff --git a/tests/specs/erc20/ds/allowance-spec.k b/tests/specs/erc20/ds/allowance-spec.k index e32f2aeb1e..84eb778f68 100644 --- a/tests/specs/erc20/ds/allowance-spec.k +++ b/tests/specs/erc20/ds/allowance-spec.k @@ -15,6 +15,7 @@ module ALLOWANCE-SPEC _ => #buf(32, ALLOWANCE) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/approve-failure-spec.k b/tests/specs/erc20/ds/approve-failure-spec.k index 5a3eb657b0..d600d08108 100644 --- a/tests/specs/erc20/ds/approve-failure-spec.k +++ b/tests/specs/erc20/ds/approve-failure-spec.k @@ -15,6 +15,7 @@ module APPROVE-FAILURE-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/approve-success-spec.k b/tests/specs/erc20/ds/approve-success-spec.k index dd7be7a8db..948a6178b1 100644 --- a/tests/specs/erc20/ds/approve-success-spec.k +++ b/tests/specs/erc20/ds/approve-success-spec.k @@ -15,6 +15,7 @@ module APPROVE-SUCCESS-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/balanceOf-spec.k b/tests/specs/erc20/ds/balanceOf-spec.k index 3f9e84299f..3d952d6675 100644 --- a/tests/specs/erc20/ds/balanceOf-spec.k +++ b/tests/specs/erc20/ds/balanceOf-spec.k @@ -15,6 +15,7 @@ module BALANCEOF-SPEC _ => #buf(32, BAL) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/totalSupply-spec.k b/tests/specs/erc20/ds/totalSupply-spec.k index c71d9b5093..44016f1a6b 100644 --- a/tests/specs/erc20/ds/totalSupply-spec.k +++ b/tests/specs/erc20/ds/totalSupply-spec.k @@ -15,6 +15,7 @@ module TOTALSUPPLY-SPEC _ => #buf(32, TOTAL) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-failure-1-a-spec.k b/tests/specs/erc20/ds/transfer-failure-1-a-spec.k index cfc079a2bd..533a907f53 100644 --- a/tests/specs/erc20/ds/transfer-failure-1-a-spec.k +++ b/tests/specs/erc20/ds/transfer-failure-1-a-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-1-A-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-failure-1-b-spec.k b/tests/specs/erc20/ds/transfer-failure-1-b-spec.k index 6174012d8f..61b7ccc875 100644 --- a/tests/specs/erc20/ds/transfer-failure-1-b-spec.k +++ b/tests/specs/erc20/ds/transfer-failure-1-b-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-1-B-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-failure-1-c-spec.k b/tests/specs/erc20/ds/transfer-failure-1-c-spec.k index f298faf490..d1d82947a5 100644 --- a/tests/specs/erc20/ds/transfer-failure-1-c-spec.k +++ b/tests/specs/erc20/ds/transfer-failure-1-c-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-1-C-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-failure-2-a-spec.k b/tests/specs/erc20/ds/transfer-failure-2-a-spec.k index 115af5a125..9f47782a61 100644 --- a/tests/specs/erc20/ds/transfer-failure-2-a-spec.k +++ b/tests/specs/erc20/ds/transfer-failure-2-a-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-2-A-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-failure-2-b-spec.k b/tests/specs/erc20/ds/transfer-failure-2-b-spec.k index 8c2d986c25..2bc40e24e8 100644 --- a/tests/specs/erc20/ds/transfer-failure-2-b-spec.k +++ b/tests/specs/erc20/ds/transfer-failure-2-b-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-2-B-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-success-1-spec.k b/tests/specs/erc20/ds/transfer-success-1-spec.k index b4c9b05ee4..e90d3d7eca 100644 --- a/tests/specs/erc20/ds/transfer-success-1-spec.k +++ b/tests/specs/erc20/ds/transfer-success-1-spec.k @@ -15,6 +15,7 @@ module TRANSFER-SUCCESS-1-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transfer-success-2-spec.k b/tests/specs/erc20/ds/transfer-success-2-spec.k index 3f20aa6b47..805802408c 100644 --- a/tests/specs/erc20/ds/transfer-success-2-spec.k +++ b/tests/specs/erc20/ds/transfer-success-2-spec.k @@ -15,6 +15,7 @@ module TRANSFER-SUCCESS-2-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-1-a-spec.k b/tests/specs/erc20/ds/transferFrom-failure-1-a-spec.k index dd3ed70e62..7f861ada67 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-1-a-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-1-a-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-1-A-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-1-b-spec.k b/tests/specs/erc20/ds/transferFrom-failure-1-b-spec.k index 9b8e455d6a..2ade34657b 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-1-b-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-1-b-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-1-B-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-1-c-spec.k b/tests/specs/erc20/ds/transferFrom-failure-1-c-spec.k index 8b5dfc7ad1..d10fd4fedb 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-1-c-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-1-c-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-1-C-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-1-d-spec.k b/tests/specs/erc20/ds/transferFrom-failure-1-d-spec.k index 6858f4ff22..b52d5a3225 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-1-d-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-1-d-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-1-D-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-2-a-spec.k b/tests/specs/erc20/ds/transferFrom-failure-2-a-spec.k index 3789c8131d..dbc3003456 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-2-a-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-2-a-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-2-A-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-2-b-spec.k b/tests/specs/erc20/ds/transferFrom-failure-2-b-spec.k index de595d0a66..6a86e267a4 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-2-b-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-2-b-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-2-B-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-failure-2-c-spec.k b/tests/specs/erc20/ds/transferFrom-failure-2-c-spec.k index a7449ccdf1..8f8b9e5875 100644 --- a/tests/specs/erc20/ds/transferFrom-failure-2-c-spec.k +++ b/tests/specs/erc20/ds/transferFrom-failure-2-c-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-2-C-SPEC _ => _ _ => EVMC_INVALID_INSTRUCTION + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-success-1-spec.k b/tests/specs/erc20/ds/transferFrom-success-1-spec.k index 3d45dcd86a..b4c8402d52 100644 --- a/tests/specs/erc20/ds/transferFrom-success-1-spec.k +++ b/tests/specs/erc20/ds/transferFrom-success-1-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-SUCCESS-1-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/ds/transferFrom-success-2-spec.k b/tests/specs/erc20/ds/transferFrom-success-2-spec.k index 4218611ed3..c7978ba72f 100644 --- a/tests/specs/erc20/ds/transferFrom-success-2-spec.k +++ b/tests/specs/erc20/ds/transferFrom-success-2-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-SUCCESS-2-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/allowance-spec.k b/tests/specs/erc20/hkg/allowance-spec.k index a5b79be23a..4d8739a7a9 100644 --- a/tests/specs/erc20/hkg/allowance-spec.k +++ b/tests/specs/erc20/hkg/allowance-spec.k @@ -15,6 +15,7 @@ module ALLOWANCE-SPEC _ => #buf(32, ALLOWANCE) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/approve-spec.k b/tests/specs/erc20/hkg/approve-spec.k index 77fed1a9e3..007286b2a8 100644 --- a/tests/specs/erc20/hkg/approve-spec.k +++ b/tests/specs/erc20/hkg/approve-spec.k @@ -15,6 +15,7 @@ module APPROVE-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/balanceOf-spec.k b/tests/specs/erc20/hkg/balanceOf-spec.k index 3271b8f07b..2960228675 100644 --- a/tests/specs/erc20/hkg/balanceOf-spec.k +++ b/tests/specs/erc20/hkg/balanceOf-spec.k @@ -15,6 +15,7 @@ module BALANCEOF-SPEC _ => #buf(32, BAL) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/totalSupply-spec.k b/tests/specs/erc20/hkg/totalSupply-spec.k index 0792cc7811..c1e5d3ab87 100644 --- a/tests/specs/erc20/hkg/totalSupply-spec.k +++ b/tests/specs/erc20/hkg/totalSupply-spec.k @@ -13,11 +13,12 @@ module TOTALSUPPLY-SPEC - _ => _ + _ => ?_ _ => EVMC_REVERT + _ => ?_ _ _ - _ => _ + _ => ?_ #parseByteStack("0x60606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063095ea7b31461007257806323b872dd146100cc57806370a0823114610145578063a9059cbb14610192578063dd62ed3e146101ec575b600080fd5b341561007d57600080fd5b6100b2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610258565b604051808215151515815260200191505060405180910390f35b34156100d757600080fd5b61012b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061034a565b604051808215151515815260200191505060405180910390f35b341561015057600080fd5b61017c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105c6565b6040518082815260200191505060405180910390f35b341561019d57600080fd5b6101d2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061060f565b604051808215151515815260200191505060405180910390f35b34156101f757600080fd5b610242600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610778565b6040518082815260200191505060405180910390f35b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610417575081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156104235750600082115b156105ba5781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506105bf565b600090505b9392505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156106605750600082115b1561076d5781600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610772565b600090505b92915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050929150505600a165627a7a723058206cb5284e8795f7d1c570318732bc1cb8add2222946156c0ba28c946531c4a2f50029") @@ -29,12 +30,12 @@ module TOTALSUPPLY-SPEC #abiCallData("totalSupply", .TypedArgs) 0 - .WordStack => _ - .Memory => _ - 0 => _ - #gas(100000, 0, 0) => _ - 0 => _ - _ => _ + .WordStack => ?_ + .Memory => ?_ + 0 => ?_ + 100000 => ?_ + 0 => ?_ + _ => ?_ false // NOTE: non-static call CALL_DEPTH diff --git a/tests/specs/erc20/hkg/transfer-failure-1-spec.k b/tests/specs/erc20/hkg/transfer-failure-1-spec.k index de2703b4aa..3f8eb91e1a 100644 --- a/tests/specs/erc20/hkg/transfer-failure-1-spec.k +++ b/tests/specs/erc20/hkg/transfer-failure-1-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-1-SPEC _ => #buf(32, 0) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transfer-failure-2-spec.k b/tests/specs/erc20/hkg/transfer-failure-2-spec.k index 9166661e61..1069e8fdd1 100644 --- a/tests/specs/erc20/hkg/transfer-failure-2-spec.k +++ b/tests/specs/erc20/hkg/transfer-failure-2-spec.k @@ -15,6 +15,7 @@ module TRANSFER-FAILURE-2-SPEC _ => #buf(32, 0) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transfer-success-1-spec.k b/tests/specs/erc20/hkg/transfer-success-1-spec.k index e41972ada6..a7c7a596fc 100644 --- a/tests/specs/erc20/hkg/transfer-success-1-spec.k +++ b/tests/specs/erc20/hkg/transfer-success-1-spec.k @@ -15,6 +15,7 @@ module TRANSFER-SUCCESS-1-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transfer-success-2-spec.k b/tests/specs/erc20/hkg/transfer-success-2-spec.k index 45b29a0617..7437e4a580 100644 --- a/tests/specs/erc20/hkg/transfer-success-2-spec.k +++ b/tests/specs/erc20/hkg/transfer-success-2-spec.k @@ -15,6 +15,7 @@ module TRANSFER-SUCCESS-2-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transferFrom-failure-1-spec.k b/tests/specs/erc20/hkg/transferFrom-failure-1-spec.k index 696853f924..46fa623791 100644 --- a/tests/specs/erc20/hkg/transferFrom-failure-1-spec.k +++ b/tests/specs/erc20/hkg/transferFrom-failure-1-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-1-SPEC _ => #buf(32, 0) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transferFrom-failure-2-spec.k b/tests/specs/erc20/hkg/transferFrom-failure-2-spec.k index 7a2cad6f11..33c21da7a3 100644 --- a/tests/specs/erc20/hkg/transferFrom-failure-2-spec.k +++ b/tests/specs/erc20/hkg/transferFrom-failure-2-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-FAILURE-2-SPEC _ => #buf(32, 0) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transferFrom-success-1-spec.k b/tests/specs/erc20/hkg/transferFrom-success-1-spec.k index e6cb1f78d2..c339513f49 100644 --- a/tests/specs/erc20/hkg/transferFrom-success-1-spec.k +++ b/tests/specs/erc20/hkg/transferFrom-success-1-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-SUCCESS-1-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/hkg/transferFrom-success-2-spec.k b/tests/specs/erc20/hkg/transferFrom-success-2-spec.k index 578f4cbd92..459e922baf 100644 --- a/tests/specs/erc20/hkg/transferFrom-success-2-spec.k +++ b/tests/specs/erc20/hkg/transferFrom-success-2-spec.k @@ -15,6 +15,7 @@ module TRANSFERFROM-SUCCESS-2-SPEC _ => #buf(32, 1) _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ diff --git a/tests/specs/erc20/verification.k b/tests/specs/erc20/verification.k index 31597329b2..d3c0652444 100644 --- a/tests/specs/erc20/verification.k +++ b/tests/specs/erc20/verification.k @@ -1,8 +1,16 @@ requires "abstract-semantics-segmented-gas.k" requires "edsl.k" requires "evm-symbolic.k" +requires "../lemmas.k" module VERIFICATION + imports VERIFICATION-JAVA + imports VERIFICATION-HASKELL + imports LEMMAS + +endmodule + +module VERIFICATION-JAVA [symbolic, kast] imports ABSTRACT-SEMANTICS-SEGMENTED-GAS imports EDSL imports EVM-SYMBOLIC @@ -17,3 +25,11 @@ module VERIFICATION rule chop ( W0:Int +Int W1:Int ) -Word W1:Int => chop ( W0 ) requires #rangeUInt(256, W0) andBool #rangeUInt(256, W1) endmodule + +module VERIFICATION-HASKELL [symbolic, kore] + + // only to pass the haskell dry-run tests + syntax Int ::= #gas ( Int , Int , Int ) [function] // startGas, nonMemory, memory + //----------------------------------------------------------------------------------- + +endmodule diff --git a/tests/specs/examples/sum-to-n-spec.k b/tests/specs/examples/sum-to-n-spec.k index 3d62f78f9f..3c350e0cf4 100644 --- a/tests/specs/examples/sum-to-n-spec.k +++ b/tests/specs/examples/sum-to-n-spec.k @@ -1,7 +1,9 @@ requires "asm.k" +requires "../lemmas.k" module VERIFICATION imports EVM-ASSEMBLY + imports LEMMAS rule #sizeWordStack ( WS , N:Int ) => N +Int #sizeWordStack ( WS , 0 ) diff --git a/tests/specs/functional/lemmas-no-smt-spec.k b/tests/specs/functional/lemmas-no-smt-spec.k new file mode 100644 index 0000000000..790b051374 --- /dev/null +++ b/tests/specs/functional/lemmas-no-smt-spec.k @@ -0,0 +1,35 @@ +requires "../lemmas.k" + +module VERIFICATION + imports LEMMAS-HASKELL + + syntax StepSort ::= Int + // ----------------------- + + syntax KItem ::= runLemma ( StepSort ) + | doneLemma( StepSort ) + // -------------------------------------- + rule runLemma( T ) => doneLemma( T ) + +endmodule + +module LEMMAS-NO-SMT-SPEC + imports VERIFICATION + + // Arithmetic simplification + // ------------------------- + + rule runLemma ( 5 +Int X ) => doneLemma ( X +Int 5 ) + rule runLemma ( X -Int 5 ) => doneLemma ( X +Int (0 -Int 5) ) + rule runLemma ( (X +Int 3) +Int 5 ) => doneLemma ( X +Int 8 ) + rule runLemma ( 3 +Int (X +Int 5) ) => doneLemma ( X +Int 8 ) + rule runLemma ( 5 -Int (X +Int 3) ) => doneLemma ( 2 -Int X ) + rule runLemma ( 5 +Int (3 +Int X) ) => doneLemma ( 8 +Int X ) + rule runLemma ( 5 +Int (3 -Int X) ) => doneLemma ( 8 -Int X ) + rule runLemma ( (5 -Int X) +Int 3 ) => doneLemma ( 8 -Int X ) + rule runLemma ( 5 -Int (3 +Int X) ) => doneLemma ( 2 -Int X ) + rule runLemma ( 5 -Int (3 -Int X) ) => doneLemma ( 2 +Int X ) + rule runLemma ( (X -Int 5) -Int 3 ) => doneLemma ( X -Int 8 ) + rule runLemma ( 5 &Int (3 &Int X) ) => doneLemma ( 1 &Int X ) + +endmodule diff --git a/tests/specs/functional/lemmas-spec.k b/tests/specs/functional/lemmas-spec.k index 8c7c5d5866..932d113fb3 100644 --- a/tests/specs/functional/lemmas-spec.k +++ b/tests/specs/functional/lemmas-spec.k @@ -19,9 +19,9 @@ module LEMMAS-SPEC // Buffer write simplifications // ---------------------------- - rule runLemma ( M [ L := .ByteArray ] [ N := WS:ByteArray ] ) => doneLemma ( M [ N := WS ] ) ... requires L <=Int N - rule runLemma ( M [ L := WS:ByteArray ] [ N := .ByteArray ] ) => doneLemma ( M [ L := WS ] ) ... requires N <=Int L - rule runLemma ( M [ 32 := (0 : 1 : 2 : .ByteArray) ] [ 32 := (3 : 4 : 5 : .ByteArray) ] ) => doneLemma ( M [ 32 := (3 : 4 : 5 : .ByteArray) ] ) ... + // rule runLemma ( M [ L := .ByteArray ] [ N := WS:ByteArray ] ) => doneLemma ( M [ N := WS ] ) ... requires L <=Int N + // rule runLemma ( M [ L := WS:ByteArray ] [ N := .ByteArray ] ) => doneLemma ( M [ L := WS ] ) ... requires N <=Int L + // rule runLemma ( M [ 32 := (0 : 1 : 2 : .ByteArray) ] [ 32 := (3 : 4 : 5 : .ByteArray) ] ) => doneLemma ( M [ 32 := (3 : 4 : 5 : .ByteArray) ] ) ... // #range selection operation // -------------------------- diff --git a/tests/specs/functional/merkle-spec.k b/tests/specs/functional/merkle-spec.k index b514a7b55d..e64cae21a5 100644 --- a/tests/specs/functional/merkle-spec.k +++ b/tests/specs/functional/merkle-spec.k @@ -22,20 +22,20 @@ module MERKLE-SPEC => doneMerkle( MerkleLeaf ( #parseByteStack("0x0607"), V ) ) rule runMerkle ( MerkleUpdate( MerkleLeaf( #parseByteStack("0x0607"), _ ), #parseByteStack("0x0608"), _ ) ) - => doneMerkle( MerkleExtension( #parseByteStack("0x06"), _ ) ) + => doneMerkle( MerkleExtension( #parseByteStack("0x06"), ?_ ) ) rule runMerkle ( MerkleUpdate( MerkleLeaf( #parseByteStack("0x05"), _ ), #parseByteStack("0x06"), _ ) ) - => doneMerkle( MerkleBranch( _, _ ) ) + => doneMerkle( MerkleBranch( ?_, ?_ ) ) // Update on MerkleExtension rule runMerkle ( MerkleUpdate( MerkleExtension( #parseByteStack("0x06"), .MerkleTree ), #parseByteStack("0x06"), V ) ) => doneMerkle( MerkleExtension( #parseByteStack("0x06"), MerkleLeaf( .ByteArray, V ) ) ) rule runMerkle ( MerkleUpdate( MerkleExtension( #parseByteStack("0x07"), _ ), #parseByteStack("0x06"), _ ) ) - => doneMerkle( MerkleBranch( _, _ ) ) + => doneMerkle( MerkleBranch( ?_, ?_ ) ) rule runMerkle ( MerkleUpdate( MerkleExtension( #parseByteStack("0x0708"), _ ), #parseByteStack("0x0709"), _ ) ) - => doneMerkle( MerkleExtension( #parseByteStack("0x07"), MerkleBranch( _, _ ) ) ) + => doneMerkle( MerkleExtension( #parseByteStack("0x07"), MerkleBranch( ?_, ?_ ) ) ) // Update on MerkleBranch rule runMerkle ( MerkleUpdate( MerkleBranch( M, _ ), .ByteArray, V ) ) diff --git a/tests/specs/imp-specs/concrete-rules.txt b/tests/specs/imp-specs/concrete-rules.txt new file mode 120000 index 0000000000..1a03906c2c --- /dev/null +++ b/tests/specs/imp-specs/concrete-rules.txt @@ -0,0 +1 @@ +../concrete-rules.txt \ No newline at end of file diff --git a/tests/specs/imp-specs/imp-specs-abstract-semantics.k b/tests/specs/imp-specs/imp-specs-abstract-semantics.k new file mode 100644 index 0000000000..45162fbb6a --- /dev/null +++ b/tests/specs/imp-specs/imp-specs-abstract-semantics.k @@ -0,0 +1,10 @@ +requires "evm-imp-specs.k" + +module IMP-SPECS-ABSTRACT-SEMANTICS + imports EVM-IMP-SPECS + + rule #assume R:Bool => . + ensures R + [trusted] + +endmodule diff --git a/tests/specs/imp-specs/imp-specs-test-spec.k b/tests/specs/imp-specs/imp-specs-test-spec.k new file mode 100644 index 0000000000..6ddf0afe60 --- /dev/null +++ b/tests/specs/imp-specs/imp-specs-test-spec.k @@ -0,0 +1,133 @@ +requires "imp-specs-abstract-semantics.k" +requires "evm-imp-specs.k" +requires "verification.k" + +module IMP-SPECS-TEST-SPEC + imports IMP-SPECS-ABSTRACT-SEMANTICS + imports EVM-IMP-SPECS + imports VERIFICATION + + rule + #saveEthereum V_CONF_BEFORE + ~> #saveOutput V_OUT_BEFORE + ~> #saveStorage ACCT_ID V_STORAGE_BEFORE + ~> #saveLog V_LOG_BEFORE + ~> #mkCallShortcut V_CONF_BEFORE CALLER_ID ACCT_ID + #abiCallData("add", #uint256(VALUE)) V_ADD_OUT + ~> #assert #getStatusCode ==S EVMC_SUCCESS + //Cannot verify due to limitations in Map unification. Lemmas don't help. + //~> #assert #getStorage(ACCT_ID) =/=S #var(V_STORAGE_BEFORE) + ~> #assume SUM:Int ==S OLD_S +Int VALUE + ~> #assert #getLog ==S (#var(V_LOG_BEFORE) +List ListItem(#abiEventLog(ACCT_ID, "TestEvent", #uint256(OLD_S), #uint256(SUM)))) + ~> #assert #getOutput ==S #var(V_ADD_OUT) + ~> #assert #sizeByteArrayExp( #buf(33, SUM) ) ==S 33 + ~> #assert (true ||S false) ==S true + ~> #assert (true ||S false) =/=S false + ~> #assert (true &&S false) ==S false + ~> #restoreEthereum V_CONF_BEFORE + ~> #assert #getOutput ==S #var(V_OUT_BEFORE) + ~> #assert #getStorage(ACCT_ID) ==S #var(V_STORAGE_BEFORE) + ~> #assert #getLog ==S #var(V_LOG_BEFORE) + => . + 1 + NORMAL + CONSTANTINOPLE + + + + _ => _ + _ => _ + _ => ?_ + _ + _ + _ => _ + + + _ => _ + _ => _ + + _ => _ // contract owner + _ => _ // who called this contract; in the begining, origin // msg.sender + + _ => _ + + 0 + .WordStack => _ + .Map => _ + 0 => _ + _ => _ + 0 => _ + #gas(INITGAS, 0, 0) => _ + + false // NOTE: non-static call + CALL_DEPTH => _ + + + + _ + _:List => _ + _ => _ + + + _ + ORIGIN_ID // who fires tx + _ + + _ + _ + _ + _ + _ + _ + _ + _ + _ + _ + _ + _ + _ + _ + _ + + _ + + + + + 0 + SetItem(ACCT_ID) _:Set + + + + ACCT_ID + _ + #parseByteStack("0x608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631003e2d2146044575b600080fd5b348015604f57600080fd5b50607960048036036020811015606457600080fd5b8101908080359060200190929190505050608f565b6040518082815260200191505060405180910390f35b6000806000549050600083600054019050806000819055507ff3ca124a697ba07e8c5e80bebcfcc48991fc16a63170e8a9206e30508960d0038282604051808381526020018281526020019250505060405180910390a1809250505091905056fea165627a7a72305820e8d8d91789cd954b1fa9161f34d260c3ad3764cdb8b8e9117be8eec773574ec90029") + #hashedLocation("Solidity", 0, .IntList) |-> (OLD_S => _) .Map + #hashedLocation("Solidity", 0, .IntList) |-> (OLD_S => _) .Map + _ + + ... + + + _ + _ + _ + + + .Map => _ + requires #rangeAddress(ACCT_ID) + andBool #rangeAddress(CALLER_ID) + andBool #rangeAddress(ORIGIN_ID) + andBool #range(0 <= CALL_DEPTH < 1020) // providing enough room for 4 calls, including test calls + andBool notBool (ACCT_ID in #precompiledAccounts(CONSTANTINOPLE)) + andBool #rangeUInt(256, OLD_S) + andBool #rangeUInt(256, VALUE) + andBool VALUE =/=Int 0 + andBool #rangeUInt(256, SUM) + andBool V_CONF_BEFORE ==K String2Id("V_CONF_BEFORE") + andBool V_OUT_BEFORE ==K String2Id("V_OUT_BEFORE") + andBool V_STORAGE_BEFORE ==K String2Id("V_STORAGE_BEFORE") + andBool V_LOG_BEFORE ==K String2Id("V_LOG_BEFORE") + andBool V_ADD_OUT ==K String2Id("V_ADD_OUT") + +endmodule diff --git a/tests/specs/imp-specs/imp-specs-test.sol b/tests/specs/imp-specs/imp-specs-test.sol new file mode 100644 index 0000000000..d0e0ad1639 --- /dev/null +++ b/tests/specs/imp-specs/imp-specs-test.sol @@ -0,0 +1,18 @@ +pragma solidity 0.5.0; + +contract ImpSpecsTest { + event TestEvent(uint _oldVal, uint _newVal); + + uint private s; + + function add(uint value) + public + returns (uint) + { + uint oldS = s; + uint sum = s + value; + s = sum; + emit TestEvent(oldS, sum); + return sum; + } +} diff --git a/tests/specs/imp-specs/verification.k b/tests/specs/imp-specs/verification.k new file mode 100644 index 0000000000..29b51d9dd6 --- /dev/null +++ b/tests/specs/imp-specs/verification.k @@ -0,0 +1,23 @@ +requires "../erc20/abstract-semantics-segmented-gas.k" +requires "edsl.k" +requires "../erc20/evm-symbolic.k" +requires "evm-imp-specs.k" +requires "../lemmas.k" + +module VERIFICATION + imports ABSTRACT-SEMANTICS-SEGMENTED-GAS + imports EDSL + imports EVM-SYMBOLIC + imports EVM-IMP-SPECS + imports LEMMAS + + //semantics of #buf + rule #buf(LEN, BYTES) => #padToWidth(LEN, #asByteStack( BYTES )) [concrete] + + //Rules for #padToWidth with non-regular symbolic arguments. + rule #padToWidth(32, #asByteStack(V)) => #buf(32, V) + requires 0 <=Int V andBool V chop ( W0 ) + requires #rangeUInt(256, W0) andBool #rangeUInt(256, W1) +endmodule diff --git a/tests/specs/lemmas.k b/tests/specs/lemmas.k index 862254ec46..ac916b73c5 100644 --- a/tests/specs/lemmas.k +++ b/tests/specs/lemmas.k @@ -2,17 +2,46 @@ requires "evm.k" requires "edsl.k" module LEMMAS + imports LEMMAS-JAVA + imports LEMMAS-HASKELL + + rule WS ++ .ByteArray => WS [simplification] + rule .ByteArray ++ WS => WS [simplification] + + //Byte array store operations sorting. Slices with lower index first. Helps applying rule below. + rule MEM [ N := BUF:ByteArray ] [ M := BUF' ] => MEM [ M := BUF' ] [ N := BUF ] + requires N >Int M andBool N -Int M >=Int #sizeByteArray(BUF') [simplification] + + rule M [ N := BUF ] [ N := BUF' ] => M [ N := BUF' ] requires #sizeByteArray(BUF) ==Int #sizeByteArray(BUF') [simplification] + + rule BUF [ L .. W ] => .ByteArray requires W ==Int 0 [simplification] + rule BUF [ 0 .. W ] => BUF requires W ==Int #sizeByteArray(BUF) [simplification] + + rule #sizeByteArray(BUF1 ++ BUF2) => #sizeByteArray(BUF1) +Int #sizeByteArray(BUF2) [simplification] + rule #sizeByteArray(#buf(SIZE, _)) => SIZE [simplification] + rule #sizeByteArray(#buf(SIZE, _)[START .. WIDTH]) => WIDTH + requires #range(0 <= START < SIZE) + andBool #range(0 < WIDTH <= SIZE -Int START) [simplification] + + rule #sizeByteArray(#range(_, START, WIDTH)) => WIDTH + requires WIDTH >=Int 0 andBool START >=Int 0 [simplification] + + //Todo custom ==K unification doesn't work in Haskell yet + //++ unification + rule #buf(N, A) ++ BUF1 ==K #buf(N, B) ++ BUF2 => #buf(N, A) ==K #buf(N, B) andBool BUF1 ==K BUF2 [simplification] + +endmodule + +module LEMMAS-JAVA [symbolic, kast] imports EVM imports EDSL imports K-REFLECTION - rule #asWord( BUF => #drop(1, BUF) ) requires BUF [ 0 ] ==Int 0 [simplification] + rule BUF [ L .. W ] => .ByteArray requires L >=Int #sizeByteArray(BUF) [simplification] - rule WS ++ .ByteArray => WS [simplification] + rule #asWord( BUF => #drop(1, BUF) ) requires BUF [ 0 ] ==Int 0 [simplification] rule #sizeByteArray(W : WS) => 1 +Int #sizeByteArray(WS) [simplification] - rule #sizeByteArray(#buf(N, _) ) => N [simplification] - rule #sizeByteArray(BUF1 ++ BUF2) => #sizeByteArray(BUF1) +Int #sizeByteArray(BUF2) [simplification] rule #sizeByteArray(#drop(N, BUF)) => maxInt(#sizeByteArray(BUF) -Int N, 0) [simplification] rule #take(N, BUF) => BUF requires N ==Int #sizeByteArray(BUF) [simplification] @@ -27,12 +56,6 @@ module LEMMAS rule #asWord(BUF) /Int 26959946667150639794667015087019630673637144422540572481103610249216 => #asWord(#take(4, BUF)) [simplification] - rule M [ N := BUF ] [ N := BUF' ] => M [ N := BUF' ] requires #sizeByteArray(BUF) ==Int #sizeByteArray(BUF') [simplification] - - rule BUF [ L .. W ] => .ByteArray requires W <=Int 0 [simplification] - rule BUF [ 0 .. W ] => BUF requires W ==Int #sizeByteArray(BUF) [simplification] - rule BUF [ L .. W ] => .ByteArray requires L >Int #sizeByteArray(BUF) [simplification] - rule #range(M, N, K) => .ByteArray requires notBool K >Int 0 [simplification] rule #range(M [ N := BUF:ByteArray ], L, K) => #range(M, L, minInt(K, N -Int L)) ++ #range(M [ N := BUF ], N, K -Int minInt(K, N -Int L)) @@ -201,6 +224,87 @@ module LEMMAS rule chop(I) => I requires 0 <=Int I andBool I (BUF1[START .. #sizeByteArray(BUF1) -Int START]) ++ (BUF2[0 .. START +Int WIDTH -Int #sizeByteArray(BUF1)]) + requires #range(0 <= START < #sizeByteArray(BUF1)) + andBool #sizeByteArray(BUF1) (BUF1[START .. WIDTH]) + requires #range(0 <= START < #sizeByteArray(BUF1)) + andBool START +Int WIDTH <=Int #sizeByteArray(BUF1) [simplification] + + rule (BUF1 ++ BUF2)[START .. WIDTH] => BUF2 [START -Int #sizeByteArray(BUF1) .. WIDTH] + requires START >=Int #sizeByteArray(BUF1) [simplification] + + rule #asWord(BUF) /Int D => #asWord(BUF[0 .. #sizeByteArray(BUF) -Int log256Int(D)]) + requires D ==Int 256 ^Int log256Int(D) andBool D >=Int 0 + andBool #sizeByteArray(BUF) >=Int log256Int(D) [simplification] + + rule #padToWidth(32, #asByteStack(V)) => #buf(32, V) + requires #rangeUInt(256, V) [simplification] + + rule #asWord(#buf(N, BUF)) => BUF + requires #range(0 < N <= 32) + andBool #range(0 <= BUF < 2 ^Int (N *Int 8)) [simplification] + + rule N &Int maxUInt160 => N + requires #rangeUInt(160, N) [simplification] + + rule maxUInt160 &Int N => N + requires #rangeUInt(160, N) [simplification] + + rule #range(M, N, K) => .ByteArray requires notBool K >Int 0 [simplification] + + rule #range(M [ N := BUF:ByteArray ], L, K) => #range(M, L, minInt(K, N -Int L)) ++ #range(M [ N := BUF ], N, K -Int minInt(K, N -Int L)) + requires K >Int 0 + andBool L BUF [ L -Int N .. minInt(K, #sizeByteArray(BUF) -Int (L -Int N)) ] ++ #range(M, N +Int #sizeByteArray(BUF), K -Int minInt(K, #sizeByteArray(BUF) -Int (L -Int N))) + requires K >Int 0 + andBool L >=Int N + andBool L #range(M, L, K) + requires K >Int 0 + andBool L >=Int N +Int #sizeByteArray(BUF) + [simplification] + + rule 0 <=Int keccak(V) => true [simplification] + rule keccak(V) <=Int maxUInt256 => true [simplification] + + // Defineness axiom for #buf + rule #Ceil(#buf(@SIZE, @DATA)) => {(@SIZE >=Int 0) #Equals true} #And #Ceil(@SIZE) #And #Ceil(@DATA) [anywhere] + + rule N <=Int maxInt(P, Q) => true requires N <=Int P orBool N <=Int Q [simplification] + rule minInt(P, Q) => P requires P <=Int Q [simplification] + rule 0 <=Int #sizeWordStack ( _ , _ ) => true [smt-lemma] + rule 0 <=Int #sizeByteArray ( _ ) => true [smt-lemma] + rule 0 <=Int lengthBytes ( _ ) => true [smt-lemma] + + rule bool2Word( B:Bool ) ==Int 1 => B [simplification] + rule bool2Word( B:Bool ) ==Int 0 => notBool B [simplification] + + // Arithmetic simplification + rule I +Int B => B +Int I [concrete(I), symbolic(B), priority(51), simplification] + rule A -Int I => A +Int (0 -Int I) [concrete(I), symbolic(A), priority(51), simplification] + + rule (A +Int I2) +Int I3 => A +Int (I2 +Int I3) [concrete(I2, I3), symbolic(A), simplification] + rule I1 +Int (B +Int I3) => B +Int (I1 +Int I3) [concrete(I1, I3), symbolic(B), simplification] + rule I1 -Int (B +Int I3) => (I1 -Int I3) -Int B [concrete(I1, I3), symbolic(B), simplification] + rule I1 +Int (I2 +Int C) => (I1 +Int I2) +Int C [concrete(I1, I2), symbolic(C), simplification] + rule I1 +Int (I2 -Int C) => (I1 +Int I2) -Int C [concrete(I1, I2), symbolic(C), simplification] + rule (I1 -Int B) +Int I3 => (I1 +Int I3) -Int B [concrete(I1, I3), symbolic(B), simplification] + rule I1 -Int (I2 +Int C) => (I1 -Int I2) -Int C [concrete(I1, I2), symbolic(C), simplification] + rule I1 -Int (I2 -Int C) => (I1 -Int I2) +Int C [concrete(I1, I2), symbolic(C), simplification] + rule (C -Int I2) -Int I3 => C -Int (I2 +Int I3) [concrete(I2, I3), symbolic(C), simplification] + rule I1 &Int (I2 &Int C) => (I1 &Int I2) &Int C [concrete(I1, I2), symbolic(C), simplification] endmodule diff --git a/tests/specs/opcodes/create-spec.k b/tests/specs/opcodes/create-spec.k index e1a1b5344c..dba8e4e388 100644 --- a/tests/specs/opcodes/create-spec.k +++ b/tests/specs/opcodes/create-spec.k @@ -24,6 +24,7 @@ module CREATE-SPEC _ => .ByteArray _ => EVMC_SUCCESS + _ => ?_ _ _ _ => _ @@ -103,6 +104,7 @@ module CREATE-SPEC _ => #generatedCode _ => EVMC_SUCCESS + _ => ?_ _ _ _ diff --git a/tests/templates/output-success-haskell.json b/tests/templates/output-success-haskell.json index 84867fd6cb..67ccc9c0fc 100644 --- a/tests/templates/output-success-haskell.json +++ b/tests/templates/output-success-haskell.json @@ -19,6 +19,9 @@ .StatusCode + + 0 + .List diff --git a/tests/templates/output-success-java.json b/tests/templates/output-success-java.json index 70d78ca5e3..2be35436cd 100644 --- a/tests/templates/output-success-java.json +++ b/tests/templates/output-success-java.json @@ -19,6 +19,9 @@ .StatusCode + + 0 + .List diff --git a/tests/templates/output-success-llvm.json b/tests/templates/output-success-llvm.json index 84867fd6cb..67ccc9c0fc 100644 --- a/tests/templates/output-success-llvm.json +++ b/tests/templates/output-success-llvm.json @@ -19,6 +19,9 @@ .StatusCode + + 0 + .List diff --git a/tests/web3/arbRollup.expected.json b/tests/web3/arbRollup.expected.json new file mode 100644 index 0000000000..33015247f8 --- /dev/null +++ b/tests/web3/arbRollup.expected.json @@ -0,0 +1,219 @@ +[ + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 19, + "result": "0x37b5ca0dc9eb95d12a92e76ebeb009725fae7bf0bd2cfef9f48aee4dcc5a027a" + }, + { + "jsonrpc": "2.0", + "id": 24, + "result": "0x40afb06f51ffd6f03fdf575c7eef987ab8f13290e0226a25136a61320fb5205b" + }, + { + "jsonrpc": "2.0", + "id": 37, + "result": "0x0466ed16acf336615c145d0187da46c58a15f27f3de23ccbaddf7da3ade26ae2" + }, + { + "jsonrpc": "2.0", + "id": 49, + "result": "0xdd24087eb474408508be2a990c4a237c817cf449558e995ee4740450736e7746" + }, + { + "jsonrpc": "2.0", + "id": 61, + "result": "0xf1cb2f7f1f0e4ce3376b64437ddb7e4158c69edf6ebb19c1a48fd4a9bc23d691" + }, + { + "jsonrpc": "2.0", + "id": 73, + "result": "0x89f8945d03074feb1280ba24dbf39e54508cbe7b365a145536f6c1b07dffe844" + }, + { + "jsonrpc": "2.0", + "id": 85, + "result": "0x1114a8ac96487616b2f12802b109078406c37fbb377d862532307dab64ca099e" + }, + { + "jsonrpc": "2.0", + "id": 94, + "result": "0xeea31331c1acd3bc9408563a6746811554c8c13dacb2de83d93638b3330377c2" + }, + { + "jsonrpc": "2.0", + "id": 106, + "result": "0x79dd768b2a4f7374ec9db944805a217fc7808fdfb2f6b330c266f0598112fe01" + }, + { + "jsonrpc": "2.0", + "id": 118, + "result": "0xc9075151fa2ec7b3fb60f505b48a86751e5dcf578b260158d255573692e2f779" + }, + { + "jsonrpc": "2.0", + "id": 130, + "result": "0x28fd8c85d1c27067a121e2b222fa4a4dc088ef0c1f40b71f2df88ff22bc28fe2" + }, + { + "jsonrpc": "2.0", + "id": 135, + "result": "0x96ea8bc4957d027190da621a517c1755123b0b701af2674893045f4583ad3cf0" + }, + { + "jsonrpc": "2.0", + "id": 1586295443094, + "result": "0x1" + }, + { + "jsonrpc": "2.0", + "id": 141, + "result": "0x968fc8782d351fb19a6c340066b39fc7c5cd2f66d6e992abf0ce134000307ab1" + }, + { + "jsonrpc": "2.0", + "id": 145, + "result": "0x691f79327da3d26b8a346fe7acfdf20211b81230108f1b3920f3b1c279278c18" + }, + { + "jsonrpc": "2.0", + "id": 1, + "result": "Firefly RPC/v0.0.1/kevm" + }, + { + "jsonrpc": "2.0", + "id": 152, + "result": "0x9c1d33b5beba26c9913b77a42bc5c3ce2a51b5a2d174c634aa71db54085ef805", + "error": { + "message": "VM Exception while processing transaction: revert MAKE_LEAF", + "code": -32000, + "data": { + "0x9c1d33b5beba26c9913b77a42bc5c3ce2a51b5a2d174c634aa71db54085ef805": { + "error": "revert", + "program_counter": 5182, + "return": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000094d414b455f4c4541460000000000000000000000000000000000000000000000", + "reason": "MAKE_LEAF" + } + } + } + }, + { + "jsonrpc": "2.0", + "id": 156, + "result": "0xe4d860dcb0f5e978d6e3cefb473b513dbb545e8dc73e6e3ccd75431b89e1eaf3", + "error": { + "message": "VM Exception while processing transaction: revert MAKE_STEP", + "code": -32000, + "data": { + "0xe4d860dcb0f5e978d6e3cefb473b513dbb545e8dc73e6e3ccd75431b89e1eaf3": { + "error": "revert", + "program_counter": 5182, + "return": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000094d414b455f535445500000000000000000000000000000000000000000000000", + "reason": "MAKE_STEP" + } + } + } + }, + { + "jsonrpc": "2.0", + "id": 160, + "result": "0xac959edcc2d48cc029386faacd96d773d44134289966b0625c045351ca5a875f", + "error": { + "message": "VM Exception while processing transaction: revert INV_STAKER", + "code": -32000, + "data": { + "0xac959edcc2d48cc029386faacd96d773d44134289966b0625c045351ca5a875f": { + "error": "revert", + "program_counter": 5182, + "return": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a494e565f5354414b455200000000000000000000000000000000000000000000", + "reason": "INV_STAKER" + } + } + } + }, + { + "jsonrpc": "2.0", + "id": 163, + "result": "0x4ee37e056e2097dbfb24798cd14f869afbd2e696dbcc6a1c0f8241a10b0af184", + "error": { + "message": "VM Exception while processing transaction: revert MAKE_TIME", + "code": -32000, + "data": { + "0x4ee37e056e2097dbfb24798cd14f869afbd2e696dbcc6a1c0f8241a10b0af184": { + "error": "revert", + "program_counter": 5182, + "return": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000094d414b455f54494d450000000000000000000000000000000000000000000000", + "reason": "MAKE_TIME" + } + } + } + }, + { + "jsonrpc": "2.0", + "id": 167, + "result": "0x79a49ac3c8c0e4e9886e4696a03cdf18d3f4dbc1da837bdbfca79412759a21ce", + "error": { + "message": "VM Exception while processing transaction: revert MAKE_MESSAGES", + "code": -32000, + "data": { + "0x79a49ac3c8c0e4e9886e4696a03cdf18d3f4dbc1da837bdbfca79412759a21ce": { + "error": "revert", + "program_counter": 5182, + "return": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000d4d414b455f4d4553534147455300000000000000000000000000000000000000", + "reason": "MAKE_MESSAGES" + } + } + } + }, + { + "jsonrpc": "2.0", + "id": 171, + "result": "0x8519989edc38129d2fc2212fbe2b306959449900a7a204a7db9f1a5e4376e936", + "error": { + "message": "VM Exception while processing transaction: revert MAKE_MESSAGE_CNT", + "code": -32000, + "data": { + "0x8519989edc38129d2fc2212fbe2b306959449900a7a204a7db9f1a5e4376e936": { + "error": "revert", + "program_counter": 5182, + "return": "0x08c379a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000104d414b455f4d4553534147455f434e5400000000000000000000000000000000", + "reason": "MAKE_MESSAGE_CNT" + } + } + } + }, + { + "jsonrpc": "2.0", + "id": 174, + "result": "0xc6aa4dda9b4763c64702fea8374b28a3fc0ddad7950304404e3526a78721791d" + }, + { + "jsonrpc": "2.0", + "id": 181, + "result": "0xfc8c3bd33adbd0affd135f31855409a4cfc27fda5d2a64d3f4d8943fbeec25eb" + }, + { + "jsonrpc": "2.0", + "id": 186, + "result": "0x0000000000000000000000000000000000000000000000000000000000000001" + } +] diff --git a/tests/web3/arbRollup.in.json b/tests/web3/arbRollup.in.json new file mode 100644 index 0000000000..f5b174850b --- /dev/null +++ b/tests/web3/arbRollup.in.json @@ -0,0 +1,361 @@ +[ + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0x7ef2290c10792957303510c120b6fb7e157a74f464f092e297e6022443a77180", + "balance": "0x152d02c7e14af6800000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_setGasLimit", + "params": [ + "0x6691b7" + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_setGasPrice", + "params": [ + "0x4a817c800" + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_genesisBlock", + "params": [ + "0x5e8cf27a" + ] + }, + { + "jsonrpc": "2.0", + "id": 19, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b50600080546001600160a01b031916331790556101b3806100326000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80630900f01014610051578063445df0ac146100795780638da5cb5b14610093578063fdacd576146100b7575b600080fd5b6100776004803603602081101561006757600080fd5b50356001600160a01b03166100d4565b005b610081610151565b60408051918252519081900360200190f35b61009b610157565b604080516001600160a01b039092168252519081900360200190f35b610077600480360360208110156100cd57600080fd5b5035610166565b6000546001600160a01b031633141561014e576000819050806001600160a01b031663fdacd5766001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b50505050505b50565b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141561014e5760015556fea265627a7a723158201e392e85e306555b95f453ba3c515983257b64bcf75e905b3ecb3af086b5815564736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 24, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0xd7174ed628bc115c5be7e3d9e5056638e40967f1", + "data": "0xfdacd5760000000000000000000000000000000000000000000000000000000000000001" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 37, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x613b51610026600b82828239805160001a60731461001957fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c80630b1cb7871461003a575b600080fd5b610152600480360361018081101561005157600080fd5b60408051808201825283359392830192916060830191906020840190600290839083908082843760009201919091525091948335946020850135946040810135151594506060810135935060808101359260a08201359260c08301359267ffffffffffffffff60e08201351692919061012081019061010001356401000000008111156100dd57600080fd5b8201836020820111156100ef57600080fd5b8035906020019184600183028401116401000000008311171561011157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610164945050505050565b60408051918252519081900360200190f35b60006101c66040518061016001604052808e81526020018d81526020018c81526020018b81526020018a151581526020018981526020018881526020018781526020018681526020018567ffffffffffffffff168152602001848152506101d6565b9c9b505050505050505050505050565b60008060008060606101e6613955565b6101ee613955565b6101f788611228565b939950929650909450925090506001600061021188611567565b67ffffffffffffffff168a610120015167ffffffffffffffff1614610274576040805162461bcd60e51b815260206004820152601460248201527324b73b30b634b21033b0b99034b710383937b7b360611b604482015290519081900360640190fd5b89608001518015610288575060ff88166072145b806102a4575089608001511580156102a4575060ff8816607214155b6102f5576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420646964496e626f78496e736e20636c61696d000000000000604482015290519081900360640190fd5b60ff88166001141561033b57610334838660008151811061031257fe5b60200260200101518760018151811061032757fe5b60200260200101516119df565b915061107b565b60ff88166002141561037a57610334838660008151811061035857fe5b60200260200101518760018151811061036d57fe5b6020026020010151611a2f565b60ff8816600314156103b957610334838660008151811061039757fe5b6020026020010151876001815181106103ac57fe5b6020026020010151611a70565b60ff8816600414156103f85761033483866000815181106103d657fe5b6020026020010151876001815181106103eb57fe5b6020026020010151611ab1565b60ff88166005141561043757610334838660008151811061041557fe5b60200260200101518760018151811061042a57fe5b6020026020010151611b02565b60ff88166006141561047657610334838660008151811061045457fe5b60200260200101518760018151811061046957fe5b6020026020010151611b53565b60ff8816600714156104b557610334838660008151811061049357fe5b6020026020010151876001815181106104a857fe5b6020026020010151611ba4565b60ff8816600814156105095761033483866000815181106104d257fe5b6020026020010151876001815181106104e757fe5b6020026020010151886002815181106104fc57fe5b6020026020010151611bf5565b60ff88166009141561055d57610334838660008151811061052657fe5b60200260200101518760018151811061053b57fe5b60200260200101518860028151811061055057fe5b6020026020010151611c5f565b60ff8816600a141561059c57610334838660008151811061057a57fe5b60200260200101518760018151811061058f57fe5b6020026020010151611cb8565b60ff8816601014156105db5761033483866000815181106105b957fe5b6020026020010151876001815181106105ce57fe5b6020026020010151611cf9565b60ff88166011141561061a5761033483866000815181106105f857fe5b60200260200101518760018151811061060d57fe5b6020026020010151611d3a565b60ff88166012141561065957610334838660008151811061063757fe5b60200260200101518760018151811061064c57fe5b6020026020010151611d7b565b60ff88166013141561069857610334838660008151811061067657fe5b60200260200101518760018151811061068b57fe5b6020026020010151611dbc565b60ff8816601414156106d75761033483866000815181106106b557fe5b6020026020010151876001815181106106ca57fe5b6020026020010151611dfd565b60ff8816601514156107015761033483866000815181106106f457fe5b6020026020010151611e29565b60ff88166016141561074057610334838660008151811061071e57fe5b60200260200101518760018151811061073357fe5b6020026020010151611e6f565b60ff88166017141561077f57610334838660008151811061075d57fe5b60200260200101518760018151811061077257fe5b6020026020010151611eb0565b60ff8816601814156107be57610334838660008151811061079c57fe5b6020026020010151876001815181106107b157fe5b6020026020010151611ef1565b60ff8816601914156107e85761033483866000815181106107db57fe5b6020026020010151611f32565b60ff8816601a141561082757610334838660008151811061080557fe5b60200260200101518760018151811061081a57fe5b6020026020010151611f68565b60ff8816601b141561086657610334838660008151811061084457fe5b60200260200101518760018151811061085957fe5b6020026020010151611fa9565b60ff88166020141561089057610334838660008151811061088357fe5b6020026020010151611fea565b60ff8816602114156108ba5761033483866000815181106108ad57fe5b6020026020010151612006565b60ff8816602214156108f95761033483866000815181106108d757fe5b6020026020010151876001815181106108ec57fe5b6020026020010151612021565b60ff88166030141561092357610334838660008151811061091657fe5b6020026020010151612087565b60ff881660311415610938576103348361208f565b60ff88166032141561094d57610334836120b0565b60ff88166033141561097757610334838660008151811061096a57fe5b60200260200101516120c9565b60ff8816603414156109a157610334838660008151811061099457fe5b60200260200101516120e2565b60ff8816603514156109e05761033483866000815181106109be57fe5b6020026020010151876001815181106109d357fe5b60200260200101516120f8565b60ff8816603614156109f55761033483612140565b60ff881660371415610a0f57610334838560000151612172565b60ff881660381415610a39576103348386600081518110610a2c57fe5b6020026020010151612184565b60ff881660391415610ac557610a4d6139b6565b610a5c8b610140015188612196565b9199509750905087610a9f5760405162461bcd60e51b8152600401808060200182810382526021815260200180613afc6021913960400191505060405180910390fd5b610aaf858263ffffffff6122e616565b610abf848263ffffffff61230816565b5061107b565b60ff8816603a1415610ada5761033483612325565b60ff8816603b1415610aeb5761107b565b60ff8816603c1415610b005761033483612345565b60ff8816603d1415610b2a576103348386600081518110610b1d57fe5b602002602001015161235e565b60ff881660401415610b54576103348386600081518110610b4757fe5b602002602001015161238c565b60ff881660411415610b93576103348386600081518110610b7157fe5b602002602001015187600181518110610b8657fe5b60200260200101516123ae565b60ff881660421415610be7576103348386600081518110610bb057fe5b602002602001015187600181518110610bc557fe5b602002602001015188600281518110610bda57fe5b60200260200101516123e0565b60ff881660431415610c26576103348386600081518110610c0457fe5b602002602001015187600181518110610c1957fe5b6020026020010151612422565b60ff881660441415610c7a576103348386600081518110610c4357fe5b602002602001015187600181518110610c5857fe5b602002602001015188600281518110610c6d57fe5b6020026020010151612434565b60ff881660501415610cb9576103348386600081518110610c9757fe5b602002602001015187600181518110610cac57fe5b6020026020010151612456565b60ff881660511415610d0d576103348386600081518110610cd657fe5b602002602001015187600181518110610ceb57fe5b602002602001015188600281518110610d0057fe5b60200260200101516124cc565b60ff881660521415610d37576103348386600081518110610d2a57fe5b6020026020010151612544565b60ff881660601415610d4c5761033483612577565b60ff881660611415610e4a57610d768386600081518110610d6957fe5b602002602001015161257d565b90925090508115610e41578961010001518a60e001518260405160200180838152602001828152602001925050506040516020818303038152906040528051906020012014610df65760405162461bcd60e51b8152600401808060200182810382526025815260200180613ab06025913960400191505060405180910390fd5b8960c001518a60a0015114610e3c5760405162461bcd60e51b8152600401808060200182810382526027815260200180613ad56027913960400191505060405180910390fd5b610e45565b5060005b61107b565b60ff881660701415610f3a57610e748386600081518110610e6757fe5b602002602001015161259f565b90925090508115610e41578960c001518a60a001518260405160200180838152602001828152602001925050506040516020818303038152906040528051906020012014610ef35760405162461bcd60e51b8152600401808060200182810382526029815260200180613a406029913960400191505060405180910390fd5b8961010001518a60e0015114610e3c5760405162461bcd60e51b8152600401808060200182810382526026815260200180613a696026913960400191505060405180910390fd5b60ff881660711415610ff5576040805160028082526060828101909352816020015b610f646139b6565b815260200190600190039081610f5c57505060208c0151909150610f989060005b60200201516001600160801b03166125b9565b81600081518110610fa557fe5b6020026020010181905250610fc48b60200151600160028110610f8557fe5b81600181518110610fd157fe5b6020026020010181905250610abf610fe882612637565b859063ffffffff61230816565b60ff88166072141561105157610334838660008151811061101257fe5b602002602001015160405180602001604052808e604001518152508d6020015160006002811061103e57fe5b60200201516001600160801b03166126e7565b60ff881660731415611066576000915061107b565b60ff88166074141561107b5761107b83612776565b8061110d578960c001518a60a00151146110c65760405162461bcd60e51b8152600401808060200182810382526027815260200180613ad56027913960400191505060405180910390fd5b8961010001518a60e001511461110d5760405162461bcd60e51b8152600401808060200182810382526026815260200180613a696026913960400191505060405180910390fd5b8161116f5760408051600160f81b602080830191909152600060218301819052602280840191909152835180840390910181526042909201909252805191012060a08401515114156111675761116283612780565b61116f565b60a083015183525b6111788461278a565b8a51146111b65760405162461bcd60e51b8152600401808060200182810382526022815260200180613a1e6022913960400191505060405180910390fd5b6111bf8361278a565b8a6060015114611216576040805162461bcd60e51b815260206004820181905260248201527f50726f6f6620686164206e6f6e206d61746368696e6720656e64207374617465604482015290519081900360640190fd5b6000985050505050505050505b919050565b60006060611234613955565b61123c613955565b60008080611248613955565b6112518161281f565b61126089610140015184612829565b9094509092509050611270613955565b6112798261293a565b905060008a6101400151858151811061128e57fe5b602001015160f81c60f81b60f81c905060008b610140015186600101815181106112b457fe5b016020015160f81c905060006112c982612998565b905060608160405190808252806020026020018201604052801561130757816020015b6112f46139b6565b8152602001906001900390816112ec5790505b5090506002880197508360ff166000148061132557508360ff166001145b611376576040805162461bcd60e51b815260206004820152601c60248201527f50726f6f662068616420626164206f7065726174696f6e207479706500000000604482015290519081900360640190fd5b60ff84166113a457604051806020016040528061139b858960000151600001516129b2565b90528652611470565b6113ac6139b6565b6113bb8f61014001518a612196565b909a50909850905087611415576040805162461bcd60e51b815260206004820152601d60248201527f50726f6f66206861642062616420696d6d6564696174652076616c7565000000604482015290519081900360640190fd5b821561143957808260008151811061142957fe5b6020026020010181905250611449565b611449868263ffffffff61230816565b604051806020016040528061146a86611461856129f9565b518b5151612b2f565b90528752505b60ff84165b828110156115035761148c8f61014001518a612196565b845185908590811061149a57fe5b602090810291909101015299509750876114fb576040805162461bcd60e51b815260206004820152601960248201527f50726f6f66206861642062616420737461636b2076616c756500000000000000604482015290519081900360640190fd5b600101611475565b815115611550575060005b8460ff168251038110156115505761154882826001855103038151811061153157fe5b60200260200101518861230890919063ffffffff16565b60010161150e565b50919d919c50939a50919850939650945050505050565b600060ff82166001141561157d57506003611223565b60ff82166002141561159157506003611223565b60ff8216600314156115a557506003611223565b60ff8216600414156115b957506004611223565b60ff8216600514156115cd57506007611223565b60ff8216600614156115e157506004611223565b60ff8216600714156115f557506007611223565b60ff82166008141561160957506004611223565b60ff82166009141561161d57506004611223565b60ff8216600a141561163157506019611223565b60ff82166010141561164557506002611223565b60ff82166011141561165957506002611223565b60ff82166012141561166d57506002611223565b60ff82166013141561168157506002611223565b60ff82166014141561169557506002611223565b60ff8216601514156116a957506001611223565b60ff8216601614156116bd57506002611223565b60ff8216601714156116d157506002611223565b60ff8216601814156116e557506002611223565b60ff8216601914156116f957506001611223565b60ff8216601a141561170d57506004611223565b60ff8216601b141561172157506007611223565b60ff82166020141561173557506007611223565b60ff82166021141561174957506003611223565b60ff82166022141561175d57506008611223565b60ff82166030141561177157506001611223565b60ff82166031141561178557506001611223565b60ff82166032141561179957506001611223565b60ff8216603314156117ad57506002611223565b60ff8216603414156117c157506004611223565b60ff8216603514156117d557506004611223565b60ff8216603614156117e957506002611223565b60ff8216603714156117fd57506001611223565b60ff82166038141561181157506001611223565b60ff82166039141561182557506001611223565b60ff8216603a141561183957506002611223565b60ff8216603b141561184d57506001611223565b60ff8216603c141561186157506001611223565b60ff8216603d141561187557506001611223565b60ff82166040141561188957506001611223565b60ff82166041141561189d57506001611223565b60ff8216604214156118b157506001611223565b60ff8216604314156118c557506001611223565b60ff8216604414156118d957506001611223565b60ff8216605014156118ed57506002611223565b60ff82166051141561190157506028611223565b60ff82166052141561191557506002611223565b60ff82166060141561192957506064611223565b60ff82166061141561193d57506064611223565b60ff82166070141561195157506064611223565b60ff82166071141561196557506028611223565b60ff82166072141561197957506028611223565b60ff82166073141561198d57506005611223565b60ff8216607414156119a15750600a611223565b6040805162461bcd60e51b815260206004820152600e60248201526d496e76616c6964206f70636f646560901b604482015290519081900360640190fd5b60006119ea83612b81565b15806119fc57506119fa82612b81565b155b15611a0957506000611a28565b82518251808201611a20878263ffffffff612b8c16565b600193505050505b9392505050565b6000611a3a83612b81565b1580611a4c5750611a4a82612b81565b155b15611a5957506000611a28565b82518251808202611a20878263ffffffff612b8c16565b6000611a7b83612b81565b1580611a8d5750611a8b82612b81565b155b15611a9a57506000611a28565b82518251808203611a20878263ffffffff612b8c16565b6000611abc83612b81565b1580611ace5750611acc82612b81565b155b15611adb57506000611a28565b8251825180611aef57600092505050611a28565b808204611a20878263ffffffff612b8c16565b6000611b0d83612b81565b1580611b1f5750611b1d82612b81565b155b15611b2c57506000611a28565b8251825180611b4057600092505050611a28565b808205611a20878263ffffffff612b8c16565b6000611b5e83612b81565b1580611b705750611b6e82612b81565b155b15611b7d57506000611a28565b8251825180611b9157600092505050611a28565b808206611a20878263ffffffff612b8c16565b6000611baf83612b81565b1580611bc15750611bbf82612b81565b155b15611bce57506000611a28565b8251825180611be257600092505050611a28565b808207611a20878263ffffffff612b8c16565b6000611c0084612b81565b1580611c125750611c1083612b81565b155b15611c1f57506000611c57565b83518351835180611c365760009350505050611c57565b6000818385089050611c4e898263ffffffff612b8c16565b60019450505050505b949350505050565b6000611c6a84612b81565b1580611c7c5750611c7a83612b81565b155b15611c8957506000611c57565b83518351835180611ca05760009350505050611c57565b6000818385099050611c4e898263ffffffff612b8c16565b6000611cc383612b81565b1580611cd55750611cd382612b81565b155b15611ce257506000611a28565b8251825180820a611a20878263ffffffff612b8c16565b6000611d0483612b81565b1580611d165750611d1482612b81565b155b15611d2357506000611a28565b82518251808210611a20878263ffffffff612b8c16565b6000611d4583612b81565b1580611d575750611d5582612b81565b155b15611d6457506000611a28565b82518251808211611a20878263ffffffff612b8c16565b6000611d8683612b81565b1580611d985750611d9682612b81565b155b15611da557506000611a28565b82518251808212611a20878263ffffffff612b8c16565b6000611dc783612b81565b1580611dd95750611dd782612b81565b155b15611de657506000611a28565b82518251808213611a20878263ffffffff612b8c16565b6000611e1f610fe8611e0e846129f9565b51611e18866129f9565b5114612ba0565b5060019392505050565b6000611e3482612b81565b611e4e57611e4983600063ffffffff612b8c16565b611e65565b81518015611e62858263ffffffff612b8c16565b50505b5060015b92915050565b6000611e7a83612b81565b1580611e8c5750611e8a82612b81565b155b15611e9957506000611a28565b82518251808216611a20878263ffffffff612b8c16565b6000611ebb83612b81565b1580611ecd5750611ecb82612b81565b155b15611eda57506000611a28565b82518251808217611a20878263ffffffff612b8c16565b6000611efc83612b81565b1580611f0e5750611f0c82612b81565b155b15611f1b57506000611a28565b82518251808218611a20878263ffffffff612b8c16565b6000611f3d82612b81565b611f4957506000611e69565b81518019611f5d858263ffffffff612b8c16565b506001949350505050565b6000611f7383612b81565b1580611f855750611f8382612b81565b155b15611f9257506000611a28565b8251825181811a611a20878263ffffffff612b8c16565b6000611fb483612b81565b1580611fc65750611fc482612b81565b155b15611fd357506000611a28565b8251825181810b611a20878263ffffffff612b8c16565b6000611e65611ff8836129f9565b51849063ffffffff612b8c16565b6000611e6561201483612bc9565b849063ffffffff61230816565b600061202c83612b81565b158061203e575061203c82612b81565b155b1561204b57506000611a28565b8251825160408051602080820185905281830184905282518083038401815260609092019092528051910120611a20878263ffffffff612b8c16565b600192915050565b60006120a8826080015183612c5290919063ffffffff16565b506001919050565b60006120a8826060015183612c5290919063ffffffff16565b60006120d4826129f9565b606084015250600192915050565b60006120ed826129f9565b835250600192915050565b600061210383612c60565b61210f57506000611a28565b61211882612b81565b61212457506000611a28565b815115611e1f57612134836129f9565b84525060019392505050565b60006120a8612165612158612153612c6d565b6129f9565b5160208501515114612ba0565b839063ffffffff61230816565b6000611e65838363ffffffff612c5216565b6000611e65838363ffffffff6122e616565b6000806121a16139b6565b845184106121c1576000846121b660006125b9565b9250925092506122df565b60008085905060008782815181106121d557fe5b016020015160019092019160f81c905060006121ef6139e4565b60ff8316612223576122018a85612cea565b919650945091508484612213846125b9565b97509750975050505050506122df565b60ff83166001141561224b576122398a85612d3d565b91965094509050848461221383612e9e565b60ff831660021415612273576122618a85612cea565b91965094509150848461221384612efe565b600360ff84161080159061228a5750600c60ff8416105b156122c557600219830160606122a1828d88612f7c565b9198509650905086866122b383612637565b995099509950505050505050506122df565b6000806122d260006125b9565b9199509750955050505050505b9250925092565b6122fc82604001516122f7836129f9565b61303a565b82604001819052505050565b61231982602001516122f7836129f9565b82602001819052505050565b60006120a8612165612338612153612c6d565b5160408501515114612ba0565b60006120a88260a0015183612c5290919063ffffffff16565b600061236982612c60565b61237557506000611e69565b61237e826129f9565b60a084015250600192915050565b600061239e838363ffffffff61230816565b611e65838363ffffffff61230816565b60006123c0848363ffffffff61230816565b6123d0848463ffffffff61230816565b611e1f848363ffffffff61230816565b60006123f2858363ffffffff61230816565b612402858463ffffffff61230816565b612412858563ffffffff61230816565b611f5d858363ffffffff61230816565b60006123d0848463ffffffff61230816565b6000612446858563ffffffff61230816565b612412858463ffffffff61230816565b600061246183612b81565b15806124735750612471826130f0565b155b1561248057506000611a28565b612489826130ff565b60ff1683600001511061249e57506000611a28565b611e1f82604001518460000151815181106124b557fe5b60200260200101518561230890919063ffffffff16565b60006124d7836130f0565b15806124e957506124e784612b81565b155b156124f657506000611c57565b6124ff836130ff565b60ff1684600001511061251457506000611c57565b81836040015185600001518151811061252957fe5b6020908102919091010152611f5d858463ffffffff61230816565b600061254f826130f0565b61255b57506000611e69565b611e65612567836130ff565b849060ff1663ffffffff612b8c16565b50600190565b600080612588613a0b565b612591846129f9565b516001969095509350505050565b60008060016125ad846129f9565b51909590945092505050565b6125c16139b6565b604080516080808201835284825282519081018352600080825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191612626565b6126136139b6565b81526020019060019003908161260b5790505b508152600060209091015292915050565b61263f6139b6565b612649825161310e565b61269a576040805162461bcd60e51b815260206004820152601a60248201527f5475706c65206d75737420686176652076616c69642073697a65000000000000604482015290519081900360640190fd5b5060408051608080820183526000808352835191820184528082526020828101829052828501829052606080840192909252830191909152918101839052915160030160ff169082015290565b60006126f284612b81565b6126fe57506000611c57565b8351821080156127155750612711613115565b8351145b612766576040805162461bcd60e51b815260206004820152601d60248201527f496e626f7820696e737472756374696f6e2077617320626c6f636b6564000000604482015290519081900360640190fd5b611f5d858463ffffffff612c5216565b600260c090910152565b600160c090910152565b600060028260c0015114156127a157506000611223565b60018260c0015114156127b657506001611223565b508051516020808301515160408085015151606080870151516080808901515160a0808b0151518751808b019b909b528a8801989098529389019490945287015285015260c0808501929092528051808503909201825260e09093019092528151910120611223565b600060c090910152565b600080612834613955565b61283c613955565b600060c0820181905261284f8787613188565b8452965090508061286957506000935084925090506122df565b6128738787613188565b6020850152965090508061289057506000935084925090506122df565b61289a8787613188565b604085015296509050806128b757506000935084925090506122df565b6128c18787613188565b606085015296509050806128de57506000935084925090506122df565b6128e88787613188565b6080850152965090508061290557506000935084925090506122df565b61290f8787613188565b60a0850152965090508061292c57506000935084925090506122df565b506001969495509392505050565b612942613955565b6040518060e0016040528083600001518152602001836020015181526020018360400151815260200183606001518152602001836080015181526020018360a0015181526020018360c001518152509050919050565b60008060006129a98460ff166131fb565b50949350505050565b60408051600160f81b60208083019190915260f89490941b6001600160f81b0319166021820152602280820193909352815180820390930183526042019052805191012090565b612a01613a0b565b6060820151600c60ff90911610612a53576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207479706520636f646560781b604482015290519081900360640190fd5b606082015160ff16612a80576040518060200160405280612a778460000151613661565b90529050611223565b606082015160ff1660011415612ac7576040518060200160405280612a77846020015160000151856020015160400151866020015160600151876020015160200151613685565b606082015160ff1660021415612aec5750604080516020810190915281518152611223565b600360ff16826060015160ff1610158015612b1057506060820151600c60ff909116105b15612b2d576040518060200160405280612a77846040015161372d565bfe5b60408051600160f81b60208083019190915260f89590951b6001600160f81b03191660218201526022810193909352604280840192909252805180840390920182526062909201909152805191012090565b6060015160ff161590565b61231982602001516122f7612153846125b9565b612ba86139b6565b8115612bbf57612bb860016125b9565b9050611223565b612bb860006125b9565b612bd16139b6565b816060015160ff1660021415612c185760405162461bcd60e51b8152600401808060200182810382526021815260200180613a8f6021913960400191505060405180910390fd5b606082015160ff16612c2e57612bb860006125b9565b816060015160ff1660011415612c4857612bb860016125b9565b612bb860036125b9565b61231982602001518261303a565b6060015160ff1660011490565b612c756139b6565b604080516080808201835260008083528351918201845280825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191612cda565b612cc76139b6565b815260200190600190039081612cbf5790505b5081526003602090910152905090565b6000806000808551905084811080612d0457506020858203105b15612d195750600092508391508290506122df565b600160208601612d2f888863ffffffff61387916565b935093509350509250925092565b600080612d486139e4565b60008490506000868281518110612d5b57fe5b602001015160f81c60f81b60f81c905081806001019250506000878381518110612d8157fe5b016020015160019384019360f89190911c915060009060ff84161415612e08576000612dab6139b6565b612db58b87612196565b909750909250905081612df9575050604080516080810182526000808252602082018190529181018290526060810182905290975088965094506122df9350505050565b612e02816129f9565b51925050505b6000612e1a8a8663ffffffff61387916565b90506020850194508360ff1660011415612e66576040805160808101825260ff909416845260208401919091526001908301819052606083019190915295509193509091506122df9050565b6040805160808101825260ff949094168452602084019190915260009083018190526060830152506001989297509550909350505050565b612ea66139b6565b604080516080810182526000808252602080830186905283518281529081018452919283019190612eed565b612eda6139b6565b815260200190600190039081612ed25790505b508152600160209091015292915050565b612f066139b6565b604080516080808201835284825282519081018352600080825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191612f6b565b612f586139b6565b815260200190600190039081612f505790505b508152600260209091015292915050565b60008060606000849050600060608860ff16604051908082528060200260200182016040528015612fc757816020015b612fb46139b6565b815260200190600190039081612fac5790505b50905060005b8960ff168160ff16101561302457612fe58985612196565b8451859060ff8616908110612ff657fe5b6020908102919091010152945092508261301c5750600095508694509250613031915050565b600101612fcd565b5060019550919350909150505b93509350939050565b613042613a0b565b6040805160028082526060828101909352816020015b613060613a0b565b815260200190600190039081613058579050509050828160008151811061308357fe5b6020026020010181905250838160018151811061309c57fe5b602002602001018190525060405180602001604052806130e660405180604001604052806130cd8860000151612efe565b81526020016130df8960000151612efe565b9052613895565b9052949350505050565b6000611e698260600151613914565b6000611e698260600151613932565b6008101590565b6040805160008082526020808301808552600360f81b948401948552835192946003938593919260418501929091028083838a5b83811015613161578181015183820152602001613149565b50505050905001925050506040516020818303038152906040528051906020012091505090565b600080613193613a0b565b8451848110806131a557506020858203105b156131c65750506040805160208101909152600080825292508391506122df565b60018560200160405180602001604052806131ea898b61387990919063ffffffff16565b905291955093509150509250925092565b6000806001831415613213575060029050600161365c565b6002831415613228575060029050600161365c565b600383141561323d575060029050600161365c565b6004831415613252575060029050600161365c565b6005831415613267575060029050600161365c565b600683141561327c575060029050600161365c565b6007831415613291575060029050600161365c565b60088314156132a6575060039050600161365c565b60098314156132bb575060039050600161365c565b600a8314156132d0575060029050600161365c565b60108314156132e5575060029050600161365c565b60118314156132fa575060029050600161365c565b601283141561330f575060029050600161365c565b6013831415613324575060029050600161365c565b6014831415613339575060029050600161365c565b601583141561334d5750600190508061365c565b6016831415613362575060029050600161365c565b6017831415613377575060029050600161365c565b601883141561338c575060029050600161365c565b60198314156133a05750600190508061365c565b601a8314156133b5575060029050600161365c565b601b8314156133ca575060029050600161365c565b60208314156133de5750600190508061365c565b60218314156133f25750600190508061365c565b6022831415613407575060029050600161365c565b603083141561341c575060019050600061365c565b6031831415613431575060009050600161365c565b6032831415613446575060009050600161365c565b603383141561345b575060019050600061365c565b6034831415613470575060019050600061365c565b6035831415613485575060029050600061365c565b603683141561349a575060009050600161365c565b60378314156134af575060009050600161365c565b60388314156134c4575060019050600061365c565b60398314156134d9575060009050600161365c565b603a8314156134ee575060009050600161365c565b603b8314156135025750600090508061365c565b603c831415613517575060009050600161365c565b603d83141561352c575060019050600061365c565b6040831415613541575060019050600261365c565b6041831415613556575060029050600361365c565b604283141561356b575060039050600461365c565b604383141561357f5750600290508061365c565b60448314156135935750600390508061365c565b60508314156135a8575060029050600161365c565b60518314156135bd575060039050600161365c565b60528314156135d15750600190508061365c565b60608314156135e55750600090508061365c565b60618314156135fa575060019050600061365c565b607083141561360f575060019050600061365c565b6071831415613624575060009050600161365c565b60728314156136385750600190508061365c565b607383141561364c5750600090508061365c565b60748314156119a1575060009050805b915091565b60408051602080820193909352815180820384018152908201909152805191012090565b600083156136df575060408051600160f81b6020808301919091526001600160f81b031960f888901b1660218301526022820185905260428083018590528351808403909101815260629092019092528051910120611c57565b5060408051600160f81b6020808301919091526001600160f81b031960f888901b16602183015260228083018590528351808403909101815260429092019092528051910120949350505050565b600060088251111561377d576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e8eae0d8ca40d8cadccee8d60631b604482015290519081900360640190fd5b606082516040519080825280602002602001820160405280156137aa578160200160208202803883390190505b50805190915060005b81811015613806576137c3613a0b565b6137df8683815181106137d257fe5b60200260200101516129f9565b905080600001518483815181106137f257fe5b6020908102919091010152506001016137b3565b508351600360ff160182604051602001808360ff1660ff1660f81b8152600101828051906020019060200280838360005b8381101561384f578181015183820152602001613837565b50505050905001925050506040516020818303038152906040528051906020012092505050919050565b6000816020018351101561388c57600080fd5b50016020015190565b60408051600280825260608281019093526000929190816020015b6138b86139b6565b8152602001906001900390816138b0575050805190915060005b8181101561390a578481600281106138e657fe5b60200201518382815181106138f757fe5b60209081029190910101526001016138d2565b50611c578261372d565b6000600c60ff8316108015611e69575050600360ff91909116101590565b600061393d82613914565b1561394d57506002198101611223565b506001611223565b6040518060e00160405280613968613a0b565b8152602001613975613a0b565b8152602001613982613a0b565b815260200161398f613a0b565b815260200161399c613a0b565b81526020016139a9613a0b565b8152602001600081525090565b6040518060800160405280600081526020016139d06139e4565b815260606020820152600060409091015290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040805160208101909152600081529056fe50726f6f6620686164206e6f6e206d61746368696e6720737461727420737461746573656e74206d65737361676520646f65736e2774206d61746368206f7574707574206d6573736167654c6f67206e6f742063616c6c65642c20627574206d657373616765206973206e6f6e7a65726f56616c7565206d757374206861766520612076616c6964207479706520636f64654c6f676765642076616c756520646f65736e2774206d61746368206f7574707574206c6f6753656e64206e6f742063616c6c65642c20627574206d657373616765206973206e6f6e7a65726f50726f6f66206f6620617578706f702068616420626164206175782076616c7565a265627a7a723158208cc24f2c87ba82f7497258b851f83ac8f43608cdc5a63a1f62f4ec7e7a9f60da64736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 49, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158208abc97ab1351de56807a56f280234a85f8b00d9e0eaab6284fa9ee82be32b28064736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 61, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b50612a15806100206000396000f3fe6080604052600436106101095760003560e01c80638f5ed73e11610095578063c3a8962c11610064578063c3a8962c14610527578063d4ce811a14610562578063e4eb8c63146108b0578063f3e414f81461092b578063f4f3b2001461096457610109565b80638f5ed73e146103fb57806396588a271461049b578063a0ef91df146104c9578063bca22b76146104de57610109565b80634d2301cc116100dc5780634d2301cc1461026f5780635bd21290146102b45780636e2b89c5146102e457806384cb7997146103175780638b7010aa146103b257610109565b8063022016811461010e5780630758fb0a1461015a57806333f2ac42146101e557806345a53f0914610218575b600080fd5b34801561011a57600080fd5b506101416004803603602081101561013157600080fd5b50356001600160a01b0316610997565b6040805192835260208301919091528051918290030190f35b34801561016657600080fd5b506101956004803603604081101561017d57600080fd5b506001600160a01b03813581169160200135166109ba565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101d15781810151838201526020016101b9565b505050509050019250505060405180910390f35b3480156101f157600080fd5b506101956004803603602081101561020857600080fd5b50356001600160a01b0316610a80565b34801561022457600080fd5b5061025b6004803603606081101561023b57600080fd5b506001600160a01b03813581169160208101359091169060400135610b43565b604080519115158252519081900360200190f35b34801561027b57600080fd5b506102a26004803603602081101561029257600080fd5b50356001600160a01b0316610bc3565b60408051918252519081900360200190f35b6102e2600480360360408110156102ca57600080fd5b506001600160a01b0381358116916020013516610bde565b005b3480156102f057600080fd5b506101956004803603602081101561030757600080fd5b50356001600160a01b0316610bf7565b34801561032357600080fd5b506102e26004803603608081101561033a57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561037457600080fd5b82018360208201111561038657600080fd5b803590602001918460018302840111600160201b831117156103a757600080fd5b509092509050610cae565b3480156103be57600080fd5b506102e2600480360360808110156103d557600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610cf8565b34801561040757600080fd5b506102e2600480360360a081101561041e57600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a081016080820135600160201b81111561045d57600080fd5b82018360208201111561046f57600080fd5b803590602001918460018302840111600160201b8311171561049057600080fd5b509092509050610d16565b6102e2600480360360408110156104b157600080fd5b506001600160a01b0381358116916020013516610d62565b3480156104d557600080fd5b506102e2610d77565b3480156104ea57600080fd5b506102e26004803603608081101561050157600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610dc2565b34801561053357600080fd5b506102a26004803603604081101561054a57600080fd5b506001600160a01b0381358116916020013516610dda565b34801561056e57600080fd5b506102e2600480360360e081101561058557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156105af57600080fd5b8201836020820111156105c157600080fd5b803590602001918460208302840111600160201b831117156105e257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561063157600080fd5b82018360208201111561064357600080fd5b803590602001918460208302840111600160201b8311171561066457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156106b357600080fd5b8201836020820111156106c557600080fd5b803590602001918460208302840111600160201b831117156106e657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561073557600080fd5b82018360208201111561074757600080fd5b803590602001918460208302840111600160201b8311171561076857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107b757600080fd5b8201836020820111156107c957600080fd5b803590602001918460018302840111600160201b831117156107ea57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561083c57600080fd5b82018360208201111561084e57600080fd5b803590602001918460018302840111600160201b8311171561086f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610e43945050505050565b3480156108bc57600080fd5b506102e2600480360360208110156108d357600080fd5b810190602081018135600160201b8111156108ed57600080fd5b8201836020820111156108ff57600080fd5b803590602001918460018302840111600160201b8311171561092057600080fd5b509092509050611003565b34801561093757600080fd5b506102e26004803603604081101561094e57600080fd5b506001600160a01b0381351690602001356110c7565b34801561097057600080fd5b506102e26004803603602081101561098757600080fd5b50356001600160a01b031661118b565b6001600160a01b0316600090815260036020526040902080546001909101549091565b6001600160a01b0380821660009081526002602090815260408083209386168352908390529020546060919080610a035750506040805160008152602081019091529050610a7a565b816001016001820381548110610a1557fe5b9060005260206000209060030201600201805480602002602001604051908101604052809291908181526020018280548015610a7057602002820191906000526020600020905b815481526020019060010190808311610a5c575b5050505050925050505b92915050565b6001600160a01b038116600090815260026020908152604091829020600181015483518181528184028101909301909352606092909183918015610ace578160200160208202803883390190505b50805190915060005b81811015610b3957836001018181548110610aee57fe5b600091825260209091206003909102015483516001600160a01b0390911690849083908110610b1957fe5b6001600160a01b0390921660209283029190910190910152600101610ad7565b5090949350505050565b6001600160a01b03808316600090815260026020908152604080832093871683529083905281205490919080610b7e57600092505050610bbc565b816001016001820381548110610b9057fe5b906000526020600020906003020160010160008581526020019081526020016000205460001415925050505b9392505050565b6001600160a01b031660009081526020819052604090205490565b610be782611258565b610bf382823334611277565b5050565b6001600160a01b03811660009081526001602081815260409283902091820154835181815281830281019092019093526060928391908015610c43578160200160208202803883390190505b50805190915060005b81811015610b3957836001018181548110610c6357fe5b600091825260209091206002909102015483516001600160a01b0390911690849083908110610c8e57fe5b6001600160a01b0390921660209283029190910190910152600101610c4c565b610cf13386868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061131592505050565b5050505050565b610d0382858361141f565b610d10848433858561149b565b50505050565b610d5a868633878787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061153492505050565b505050505050565b610d6b33611258565b610bf333838334611277565b6000610d8233610bc3565b3360008181526020819052604080822082905551929350909183156108fc0291849190818181858888f19350505050158015610bf3573d6000803e3d6000fd5b610dcd8285836115db565b610d108484338585611668565b6001600160a01b03808216600090815260016020908152604080832093861683529083905281205490919080610e1557600092505050610a7a565b816001016001820381548110610e2757fe5b9060005260206000209060020201600101549250505092915050565b855185516000908214610e92576040805162461bcd60e51b81526020600482015260126024820152710eee4dedcce40d2dce0eae840d8cadccee8d60731b604482015290519081900360640190fd5b81865114610edc576040805162461bcd60e51b81526020600482015260126024820152710eee4dedcce40d2dce0eae840d8cadccee8d60731b604482015290519081900360640190fd5b81855114610f26576040805162461bcd60e51b81526020600482015260126024820152710eee4dedcce40d2dce0eae840d8cadccee8d60731b604482015290519081900360640190fd5b6001600160a01b0389166000908152600360205260408120805490915b84811015610feb576000888281518110610f5957fe5b602002602001015190506060610f7a86838b6117019092919063ffffffff16565b905081860195506000610fce8f8f8681518110610f9357fe5b60200260200101518f8781518110610fa757fe5b60200260200101518f8881518110610fbb57fe5b6020026020010151868e8a604102611781565b9050610fda858261192f565b94505060019092019150610f439050565b50815560010180549092019091555050505050505050565b6000808080845b808410156110be5761105387878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525088925061195b915050565b9297509095509350915084611067576110be565b6110aa87878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250889250879150611a1d9050565b9095509350846110b9576110be565b61100a565b50505050505050565b6110d2338383611b21565b611123576040805162461bcd60e51b815260206004820152601860248201527f57616c6c657420646f65736e2774206f776e20746f6b656e0000000000000000604482015290519081900360640190fd5b60408051632142170760e11b81523060048201523360248201526044810183905290516001600160a01b038416916342842e0e91606480830192600092919082900301818387803b15801561117757600080fd5b505af1158015610d5a573d6000803e3d6000fd5b60006111978233610dda565b90506111a4338383611d89565b6111df5760405162461bcd60e51b815260040180806020018281038252602e8152602001806129b3602e913960400191505060405180910390fd5b6040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b0384169163a9059cbb9160448083019260209291908290030181600087803b15801561122e57600080fd5b505af1158015611242573d6000803e3d6000fd5b505050506040513d6020811015610d1057600080fd5b6001600160a01b03166000908152602081905260409020805434019055565b6001600160a01b038416600090815260036020526040812060019081015401906112a48585854386611f1c565b90506112b08682611f87565b336001600160a01b0316856001600160a01b0316876001600160a01b03167ffd0d0553177fec183128f048fbde54554a3a67302f7ebd7f735215a3582907053486604051808381526020018281526020019250505060405180910390a4505050505050565b6001600160a01b03851660009081526003602052604081206001908101540190611343868686864387611fbd565b905061134f8782611f87565b846001600160a01b0316866001600160a01b0316886001600160a01b03167f362b3acbdbf0277aefa83754ea8d39fc1c55d01d9351cf78969923f8cfee612c8787876040518084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156113da5781810151838201526020016113c2565b50505050905090810190601f1680156114075780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a450505050505050565b604080516323b872dd60e01b81523360048201523060248201526044810183905290516001600160a01b038516916323b872dd91606480830192600092919082900301818387803b15801561147357600080fd5b505af1158015611487573d6000803e3d6000fd5b50505050611496828483612091565b505050565b6001600160a01b038516600090815260036020526040812060019081015401906114c9868686864387612215565b90506114d58782611f87565b604080516001600160a01b0386811682526020820186905281830185905291518288169289811692908b16917f40baf11a4a4a4be2a155dbf303fbaec6fabd52e267268bd7e3de4b4ed8a2e0959181900360600190a450505050505050565b600061154587878787878743612232565b90506115518782611f87565b846001600160a01b0316866001600160a01b0316886001600160a01b03167fcf612c95e8993eca9c6e0be96b26b47022996db601dc12b4cf68ec37829d87b3878787604051808481526020018381526020018060200182810382528381815181526020019150805190602001908083836000838110156113da5781810151838201526020016113c2565b604080516323b872dd60e01b81523360048201523060248201526044810183905290516001600160a01b038516916323b872dd9160648083019260209291908290030181600087803b15801561163057600080fd5b505af1158015611644573d6000803e3d6000fd5b505050506040513d602081101561165a57600080fd5b506114969050828483612327565b6001600160a01b038516600090815260036020526040812060019081015401906116968686868643876123fe565b90506116a28782611f87565b604080516001600160a01b0386811682526020820186905281830185905291518288169289811692908b16917fb13d04085b4a9f87fecfccf9b72081bb8a273498d6b08b4bccf2940d555b5e609181900360600190a450505050505050565b60608183018451101561171357600080fd5b60608215801561172e57604051915060208201604052611778565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561176757805183526020928301920161174f565b5050858452601f01601f1916604052505b50949350505050565b600080611846898989898960405160200180866001600160a01b03166001600160a01b031660601b8152601401856001600160a01b03166001600160a01b031660601b815260140184815260200183815260200182805190602001908083835b602083106118005780518252601f1990920191602091820191016117e1565b6001836020036101000a03801982511681845116808217855250505050505090500195505050505050604051602081830303815290604052805190602001208585612410565b905060006118598a8a848b8b8b43612232565b9050816001600160a01b0316896001600160a01b03168b6001600160a01b03167fcf612c95e8993eca9c6e0be96b26b47022996db601dc12b4cf68ec37829d87b38b8b8b6040518084815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156118e65781810151838201526020016118ce565b50505050905090810190601f1680156119135780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a49998505050505050505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b60008060008060008060008088905060008a828151811061197857fe5b016020015160019092019160f81c9050600681146119a8575060009750889650879550859450611a149350505050565b6119b28b83612543565b9196509094509150846119d7575060009750889650879550859450611a149350505050565b6119e18b83612543565b919650909350915084611a06575060009750889650879550859450611a149350505050565b506001975095509093509150505b92959194509250565b6000806001831415611a7257600080600080611a3989896125bb565b935093509350935083611a56576000889550955050505050611b19565b611a61338383612608565b506001839550955050505050611b19565b6002831415611acb576000806000806000611a8d8a8a612666565b9450945094509450945084611aad57600089965096505050505050611b19565b611ab93383858461276d565b50600184965096505050505050611b19565b6003831415611b12576000806000806000611ae68a8a612666565b9450945094509450945084611b0657600089965096505050505050611b19565b611ab93383858461279d565b5060009050825b935093915050565b6001600160a01b03808416600090815260026020908152604080832093861683529083905281205490919080611b5c57600092505050610bbc565b6000826001016001830381548110611b7057fe5b600091825260208083208884526001600390930201918201905260409091205490915080611ba5576000945050505050610bbc565b60028201805482916001850191600091906000198101908110611bc457fe5b600091825260208083209091015483528201929092526040019020556002820180546000198101908110611bf457fe5b9060005260206000200154826002016001830381548110611c1157fe5b600091825260208083209091019290925587815260018401909152604081205560028201805480611c3e57fe5b6000828152602081208201600019908101919091550190556002820154611d7b5760018401805484918691600091906000198101908110611c7b57fe5b600091825260208083206003909202909101546001600160a01b031683528201929092526040019020556001840180546000198101908110611cb957fe5b9060005260206000209060030201846001016001850381548110611cd957fe5b60009182526020909120825460039092020180546001600160a01b0319166001600160a01b0390921691909117815560028083018054611d1c92840191906128e9565b5050506001600160a01b03871660009081526020859052604081205560018401805480611d4557fe5b60008281526020812060036000199093019283020180546001600160a01b031916815590611d766002830182612939565b505090555b506001979650505050505050565b600081611d9857506001610bbc565b6001600160a01b03808516600090815260016020908152604080832093871683529083905290205480611dd057600092505050610bbc565b6000826001016001830381548110611de457fe5b906000526020600020906002020190508060010154851115611e0c5760009350505050610bbc565b60018101805486900390819055611f0f5760018301805483918591600091906000198101908110611e3957fe5b600091825260208083206002909202909101546001600160a01b031683528201929092526040019020556001830180546000198101908110611e7757fe5b9060005260206000209060020201836001016001840381548110611e9757fe5b60009182526020808320845460029093020180546001600160a01b0319166001600160a01b0393841617815560019485015490850155908916825285905260408120558301805480611ee557fe5b60008281526020812060026000199093019283020180546001600160a01b03191681556001015590555b5060019695505050505050565b60408051600160f81b6020808301919091526bffffffffffffffffffffffff19606089811b8216602185015288901b166035830152604982018690526069820185905260898083018590528351808403909101815260a9909201909252805191012095945050505050565b6001600160a01b03821660009081526003602052604090208054611fab908361192f565b81556001908101805490910190555050565b60006004878787878787604051602001808860ff1660ff1660f81b8152600101876001600160a01b03166001600160a01b031660601b8152601401866001600160a01b03166001600160a01b031660601b815260140185815260200184805190602001908083835b602083106120445780518252601f199092019160209182019101612025565b51815160209384036101000a600019018019909216911617905292019485525083810192909252506040805180840383018152928101905281519101209c9b505050505050505050505050565b6001600160a01b03808416600090815260026020908152604080832093861683529083905290205480612151576040805180820182526001600160a01b0386811682528251600080825260208083019095528484019182526001878101805491820180825590835291869020855160039092020180546001600160a01b031916919094161783559051805191946121309260028501929091019061295a565b5050506001600160a01b038516600090815260208490526040902081905590505b600082600101600183038154811061216557fe5b90600052602060002090600302019050806001016000858152602001908152602001600020546000146121df576040805162461bcd60e51b815260206004820152601d60248201527f63616e27742061646420616c7265616479206f776e656420746f6b656e000000604482015290519081900360640190fd5b60028101805460018181018355600083815260208082209093018890559254968352909201909152604090209290925550505050565b600061222760038888888888886127c1565b979650505050505050565b60008088888888888888604051602001808960ff1660ff1660f81b8152600101886001600160a01b03166001600160a01b031660601b8152601401876001600160a01b03166001600160a01b031660601b8152601401866001600160a01b03166001600160a01b031660601b815260140185815260200184815260200183805190602001908083835b602083106122da5780518252601f1990920191602091820191016122bb565b51815160001960209485036101000a019081169019919091161790529201938452506040805180850381529382019052825192019190912098505050505050505050979650505050505050565b8061233157611496565b6001600160a01b038084166000908152600160209081526040808320938616835290839052902054806123ca57506040805180820182526001600160a01b0385811680835260006020808501828152600188810180548083018083559186528486209851600290910290980180546001600160a01b03191698909716979097178655905194019390935590815290849052919091208190555b828260010160018303815481106123dd57fe5b60009182526020909120600160029092020101805490910190555050505050565b600061222760028888888888886127c1565b60008060008060606040518060400160405280601c81526020017f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152509050600081896040516020018083805190602001908083835b602083106124865780518252601f199092019160209182019101612467565b51815160209384036101000a60001901801990921691161790529201938452506040805180850381529382019052825192019190912092506124cc91508990508861283f565b6040805160008152602080820180845287905260ff8616828401526060820185905260808201849052915194995092975090955060019260a080840193601f198301929081900390910190855afa15801561252b573d6000803e3d6000fd5b5050604051601f1901519a9950505050505050505050565b600080600080855190508481108061255d57506021858203105b8061257f5750600060ff1686868151811061257457fe5b016020015160f81c14155b156125945750600092508391508290506125b4565b6001602186016125ac8888840163ffffffff6128cd16565b935093509350505b9250925092565b60008060008060008060008088905060008a82815181106125d857fe5b016020015160019092019160f81c9050600581146119a8575060009750889650879550859450611a149350505050565b6001600160a01b03831660009081526020819052604081205482111561263057506000610bbc565b506001600160a01b0392831660009081526020819052604080822080548490039055929093168352912080549091019055600190565b6000806000806000806000806000808a905060008c828151811061268657fe5b016020015160019092019160f81c9050600681146126ba5750600099508a9850899750879650869550612763945050505050565b6126c48d83612543565b9197509095509150856126ed5750600099508a9850899750879650869550612763945050505050565b6126f78d83612543565b9197509094509150856127205750600099508a9850899750879650869550612763945050505050565b61272a8d83612543565b9197509093509150856127535750600099508a9850899750879650869550612763945050505050565b5060019950975091955093509150505b9295509295909350565b600061277a858484611d89565b61278657506000612795565b612791848484612327565b5060015b949350505050565b60006127aa858484611b21565b6127b657506000612795565b612791848484612091565b6040805160f89890981b6001600160f81b0319166020808a0191909152606097881b6bffffffffffffffffffffffff1990811660218b015296881b871660358a01529490961b9094166049870152605d860191909152607d850152609d808501929092528251808503909201825260bd909301909152805191012090565b604180820283810160208101516040820151919093015160ff169291601b84101561286b57601b840193505b8360ff16601b148061288057508360ff16601c145b6128c5576040805162461bcd60e51b8152602060048201526011602482015270496e636f727265637420762076616c756560781b604482015290519081900360640190fd5b509250925092565b600081602001835110156128e057600080fd5b50016020015190565b8280548282559060005260206000209081019282156129295760005260206000209182015b8281111561292957825482559160010191906001019061290e565b50612935929150612995565b5090565b50805460008255906000526020600020908101906129579190612995565b50565b828054828255906000526020600020908101928215612929579160200282015b8281111561292957825182559160200191906001019061297a565b6129af91905b80821115612935576000815560010161299b565b9056fe57616c6c657420646f65736e2774206f776e2073756666696369656e742062616c616e6365206f6620746f6b656ea265627a7a7231582095ad6ed55dc2c548021751d6b7eeab0be2fbcc2dc96fe10130c715e5cf50f59d64736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 73, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b50612fc0806100206000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c80636cb4b10a116100665780636cb4b10a146102a457806379a9ad85146102f95780639c4e4e85146103a9578063ced5c1bf1461047f578063d9b94b4a1461048757610093565b806302ad1e4e14610098578063293a3b88146100dc578063500439e51461012a578063569d893d1461024f575b600080fd5b6100da600480360360a08110156100ae57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135610568565b005b6100da600480360360e08110156100f257600080fd5b508035906020810135906001600160a01b03604082013581169160608101359091169060808101359060a08101359060c0013561057d565b6100da6004803603606081101561014057600080fd5b810190602081018135600160201b81111561015a57600080fd5b82018360208201111561016c57600080fd5b803590602001918460208302840111600160201b8311171561018d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156101dc57600080fd5b8201836020820111156101ee57600080fd5b803590602001918460208302840111600160201b8311171561020f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610772915050565b6100da600480360361010081101561026657600080fd5b508035906020810135906001600160a01b03604082013581169160608101358216916080820135169060a08101359060c08101359060e00135610bf1565b6100da60048036036101008110156102bb57600080fd5b508035906020810135906001600160a01b03604082013581169160608101358216916080820135169060a08101359060c08101359060e00135610dac565b6100da6004803603608081101561030f57600080fd5b81359190810190604081016020820135600160201b81111561033057600080fd5b82018360208201111561034257600080fd5b803590602001918460018302840111600160201b8311171561036357600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350505060200135610f4d565b6100da60048036036101008110156103c057600080fd5b8135916020810135916001600160a01b0360408301358116926060810135909116916080820135919081019060c0810160a0820135600160201b81111561040657600080fd5b82018360208201111561041857600080fd5b803590602001918460018302840111600160201b8311171561043957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550508235935050506020013561120e565b6100da6113af565b6100da600480360361012081101561049e57600080fd5b8135916020810135916001600160a01b036040830135811692606081013582169260808201359092169160a08201359160c081013591810190610100810160e0820135600160201b8111156104f257600080fd5b82018360208201111561050457600080fd5b803590602001918460018302840111600160201b8311171561052557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061148f915050565b6105748585858561164d565b60065550505050565b60055460ff16600281111561058e57fe5b600114604051806040016040528060098152602001684249535f535441544560b81b8152509061063c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106015781810151838201526020016105e9565b50505050905090810190601f16801561062e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060035461064943611768565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b815250906106bc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b031633146107385760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060006107488686868686611773565b9050600061075987878787876117de565b9050610767898984846119ba565b505050505050505050565b60055460ff16600281111561078357fe5b600114604051806040016040528060098152602001684249535f535441544560b81b815250906107f45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060035461080143611768565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b815250906108745760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b031633146108f05760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b508251825160408051808201909152600d81526c2429afa124a9afa4a7282622a760991b602082015260001983019290911461096d5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b506109d16109cc8560008151811061098157fe5b602002602001015186848151811061099557fe5b6020026020010151866000815181106109aa57fe5b60200260200101518786815181106109be57fe5b602002602001015187611a14565b611a5a565b6060816040519080825280602002602001820160405280156109fd578160200160208202803883390190505b509050610a6685600081518110610a1057fe5b602002602001015186600181518110610a2557fe5b602002602001015186600081518110610a3a57fe5b602002602001015187600181518110610a4f57fe5b6020026020010151610a618888611ad0565b611a14565b81600081518110610a7357fe5b602090810291909101015260015b82811015610b0b57610aec868281518110610a9857fe5b6020026020010151878360010181518110610aaf57fe5b6020026020010151878481518110610ac357fe5b6020026020010151888560010181518110610ada57fe5b6020026020010151610a618989611aee565b828281518110610af857fe5b6020908102919091010152600101610a81565b50610b1581611b01565b610b1d611b10565b7f500c4a1bbd12a65d684bde95626a41abdd6a8c5d30f84c5c9b81e5bdb0cc0bd3858585600354604051808060200180602001858152602001848152602001838103835287818151815260200191508051906020019060200280838360005b83811015610b94578181015183820152602001610b7c565b50505050905001838103825286818151815260200191508051906020019060200280838360005b83811015610bd3578181015183820152602001610bbb565b50505050905001965050505050505060405180910390a15050505050565b60055460ff166002811115610c0257fe5b600114604051806040016040528060098152602001684249535f535441544560b81b81525090610c735760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b50600354610c8043611768565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b81525090610cf35760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b03163314610d6f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b506000610d80878787878787611b2d565b90506000610d92888888888888611b4a565b9050610da08a8a84846119ba565b50505050505050505050565b60055460ff166002811115610dbd57fe5b600114604051806040016040528060098152602001684249535f535441544560b81b81525090610e2e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b50600354610e3b43611768565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b81525090610eae5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b03163314610f2a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b506000610f3b878787878787611b5c565b90506000610d92888888888888611b6e565b60055460ff166002811115610f5e57fe5b60021460405180604001604052806009815260200168434f4e5f535441544560b81b81525090610fcf5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b50600354610fdc43611768565b11156040518060400160405280600c81526020016b434f4e5f444541444c494e4560a01b8152509061104f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060025460408051808201909152600a81526921a7a72fa9a2a72222a960b11b6020820152906001600160a01b031633146110cb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060065482146040518060400160405280600881526020016721a7a72fa82922ab60c11b8152509061113e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5061114e83838387600101611b80565b6040518060400160405280600981526020016821a7a72fa82927a7a360b91b815250906111bc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060068190556111ca611c83565b60035460408051868152602081019290925280517f1e1c1e4e68a25c69a078a396e73975691c071d69ef789015dc16a562957804e49281900390910190a150505050565b60055460ff16600281111561121f57fe5b600114604051806040016040528060098152602001684249535f535441544560b81b815250906112905760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060035461129d43611768565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b815250906113105760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b0316331461138c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b50600061139d878787878787611c96565b90506000610d92888888888888611d6a565b6003546113bb43611768565b1161140d576040805162461bcd60e51b815260206004820152601760248201527f446561646c696e65206861736e27742065787069726564000000000000000000604482015290519081900360640190fd5b600160055460ff16600281111561142057fe5b141561145c576040517f2b92a4b014281aa2424baba9ea60bf4f26833d1c1fbd873e51cd1a6caeef48f090600090a1611457611f05565b61148d565b6040517f4e1f1f06cf69d199fcdb4d87a5a92d5248ca6b540e9fc2d3698927c5002a236a90600090a161148d611f10565b565b60055460ff1660028111156114a057fe5b600114604051806040016040528060098152602001684249535f535441544560b81b815250906115115760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060035461151e43611768565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b815250906115915760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b0316331461160d5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b50600061161f88888888888888611f18565b905060006116328989898989898961200d565b90506116408b8b84846119ba565b5050505050505050505050565b600060055460ff16600281111561166057fe5b146040518060400160405280600f81526020016e4348414c5f494e49545f535441544560881b815250906116d55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b50600080546001600160a01b038681166001600160a01b03199283161790925560018054868416908316178155600280549386169390921692909217905560048290556005805460ff1916909117905561172d6122a1565b60035460408051918252517fe070f23072cbc6c0fc7253b8d0120649d5f9d6e19a8aeab79eb50aa6360bcc679181900360200190a150505050565b6103e881025b919050565b60408051600160f81b6020808301919091526bffffffffffffffffffffffff19606089811b8216602185015288901b166035830152604982018690526069820185905260898083018590528351808403909101815260a9909201909252805191012095945050505050565b60408051600280825260608281019093526000929190816020015b611801612f24565b8152602001906001900390816117f9579050509050611828876001600160a01b03166122b3565b8160008151811061183557fe5b6020026020010181905250611849856122b3565b8160018151811061185657fe5b602090810291909101015260408051600380825260808201909252606091816020015b611881612f24565b8152602001906001900390816118795790505090506118a060016122b3565b816000815181106118ad57fe5b60200260200101819052506118ca876001600160a01b03166122b3565b816001815181106118d757fe5b60200260200101819052506118eb82612331565b816002815181106118f857fe5b602090810291909101015260408051600380825260808201909252606091816020015b611923612f24565b81526020019060019003908161191b579050509050611941866122b3565b8160008151811061194e57fe5b6020026020010181905250611962856122b3565b8160018151811061196f57fe5b602002602001018190525061198382612331565b8160028151811061199057fe5b60200260200101819052506119ac6119a782612331565b6123e1565b519998505050505050505050565b6119dd6109cc856119cb8786612517565b866119d68887612543565b6001611a14565b6040517f117efdf1fdd8be5a6ff0fb3c32333d7033bbd9523924bd0d9ca28f43540516f590600090a1611a0e611f10565b50505050565b60408051602080820197909752808201959095526060850193909352608084019190915260a0808401919091528151808403909101815260c09092019052805191012090565b6006548114604051806040016040528060088152602001672124a9afa82922ab60c11b81525090611acc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156106015781810151838201526020016105e9565b5050565b6000818381611adb57fe5b06828481611ae557fe5b04019392505050565b6000818381611af957fe5b049392505050565b611b0a81612578565b60065550565b600580546002919060ff19166001835b021790555061148d6122a1565b6000611b3f60028888888888886126b6565b979650505050505050565b6000611b3f6002888888888888612734565b6000611b3f60038888888888886126b6565b6000611b3f6003888888888888612734565b600080838160205b88518111611c73578089015193506020818a510360200181611ba657fe5b0491505b600082118015611bbd5750600286066001145b8015611bcb57508160020a86115b15611bde57600286046001019550611baa565b60028606611c29578383604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925060028681611c2157fe5b049550611c6b565b8284604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925060028681611c6457fe5b0460010195505b602001611b88565b505085149150505b949350505050565b600580546001919060ff19168280611b20565b60006004878787878787604051602001808860ff1660ff1660f81b8152600101876001600160a01b03166001600160a01b031660601b8152601401866001600160a01b03166001600160a01b031660601b815260140185815260200184805190602001908083835b60208310611d1d5780518252601f199092019160209182019101611cfe565b51815160209384036101000a600019018019909216911617905292019485525083810192909252506040805180840383018152928101905281519101209c9b505050505050505050505050565b600080611d768561293a565b6040805160038082526080820190925291925060609190816020015b611d9a612f24565b815260200190600190039081611d92579050509050611dc1896001600160a01b03166122b3565b81600081518110611dce57fe5b6020026020010181905250611de2876122b3565b81600281518110611def57fe5b6020026020010181905250611e0382612a2e565b81600381518110611e1057fe5b602090810291909101015260408051600380825260808201909252606091816020015b611e3b612f24565b815260200190600190039081611e33579050509050611e5a60046122b3565b81600081518110611e6757fe5b6020026020010181905250611e84896001600160a01b03166122b3565b81600181518110611e9157fe5b6020026020010181905250611ea582612331565b81600281518110611eb257fe5b6020026020010181905250611ef76040518060600160405280611ed4896122b3565b8152602001611ee2886122b3565b8152602001611ef084612331565b9052612aac565b9a9950505050505050505050565b611f0d612b2c565b33ff5b611f0d612ba2565b60008088888888888888604051602001808960ff1660ff1660f81b8152600101886001600160a01b03166001600160a01b031660601b8152601401876001600160a01b03166001600160a01b031660601b8152601401866001600160a01b03166001600160a01b031660601b815260140185815260200184815260200183805190602001908083835b60208310611fc05780518252601f199092019160209182019101611fa1565b51815160001960209485036101000a019081169019919091161790529201938452506040805180850381529382019052825192019190912098505050505050505050979650505050505050565b6000806000898989898989604051602001808860ff1660ff1660f81b8152600101876001600160a01b03166001600160a01b031660601b8152601401866001600160a01b03166001600160a01b031660601b8152601401856001600160a01b03166001600160a01b031660601b815260140184815260200183815260200182805190602001908083835b602083106120b65780518252601f199092019160209182019101612097565b6001836020036101000a03801982511681845116808217855250505050505090500197505050505050505060405160208183030381529060405280519060200120905060006121048561293a565b60408051600480825260a0820190925291925060609190816020015b612128612f24565b81526020019060019003908161212057905050905061214f8a6001600160a01b03166122b3565b8160008151811061215c57fe5b6020026020010181905250612170886122b3565b8160018151811061217d57fe5b6020026020010181905250612191876122b3565b8160028151811061219e57fe5b60200260200101819052506121b282612a2e565b816003815181106121bf57fe5b602090810291909101015260408051600380825260808201909252606091816020015b6121ea612f24565b8152602001906001900390816121e257905050905061220960006122b3565b8160008151811061221657fe5b60200260200101819052506122338a6001600160a01b03166122b3565b8160018151811061224057fe5b602002602001018190525061225482612331565b8160028151811061226157fe5b60200260200101819052506122916040518060600160405280612283896122b3565b8152602001611ee2876122b3565b9c9b505050505050505050505050565b6004546122ad43611768565b01600355565b6122bb612f24565b604080516080808201835284825282519081018352600080825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191612320565b61230d612f24565b8152602001906001900390816123055790505b508152600060209091015292915050565b612339612f24565b6123438251612c01565b612394576040805162461bcd60e51b815260206004820152601a60248201527f5475706c65206d75737420686176652076616c69642073697a65000000000000604482015290519081900360640190fd5b5060408051608080820183526000808352835191820184528082526020828101829052828501829052606080840192909252830191909152918101839052915160030160ff169082015290565b6123e9612f52565b6060820151600c60ff9091161061243b576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207479706520636f646560781b604482015290519081900360640190fd5b606082015160ff1661246857604051806020016040528061245f8460000151612c08565b9052905061176e565b606082015160ff16600114156124af57604051806020016040528061245f846020015160000151856020015160400151866020015160600151876020015160200151612c2c565b606082015160ff16600214156124d4575060408051602081019091528151815261176e565b600360ff16826060015160ff16101580156124f857506060820151600c60ff909116105b1561251557604051806020016040528061245f8460400151612cd4565bfe5b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6000612571604051806040016040528061255c86612a2e565b815260200161256a85612a2e565b9052612e20565b9392505050565b6000815b600181511115612699576060600282516001018161259657fe5b046040519080825280602002602001820160405280156125c0578160200160208202803883390190505b50905060005b8151811015612691578251816002026001011015612659578281600202815181106125ed57fe5b602002602001015183826002026001018151811061260757fe5b602002602001015160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012082828151811061264857fe5b602002602001018181525050612689565b82816002028151811061266857fe5b602002602001015182828151811061267c57fe5b6020026020010181815250505b6001016125c6565b50905061257c565b806000815181106126a657fe5b6020026020010151915050919050565b6040805160f89890981b6001600160f81b0319166020808a0191909152606097881b6bffffffffffffffffffffffff1990811660218b015296881b871660358a01529490961b9094166049870152605d860191909152607d850152609d808501929092528251808503909201825260bd909301909152805191012090565b6040805160038082526080820190925260009160609190816020015b612758612f24565b81526020019060019003908161275057905050905061277f866001600160a01b03166122b3565b8160008151811061278c57fe5b60200260200101819052506127a9886001600160a01b03166122b3565b816001815181106127b657fe5b60200260200101819052506127ca856122b3565b816002815181106127d757fe5b602090810291909101015260408051600380825260808201909252606091816020015b612802612f24565b8152602001906001900390816127fa5790505090506128238a60ff166122b3565b8160008151811061283057fe5b602002602001018190525061284d886001600160a01b03166122b3565b8160018151811061285a57fe5b602002602001018190525061286e82612331565b8160028151811061287b57fe5b602090810291909101015260408051600380825260808201909252606091816020015b6128a6612f24565b81526020019060019003908161289e5790505090506128c4866122b3565b816000815181106128d157fe5b60200260200101819052506128e5856122b3565b816001815181106128f257fe5b602002602001018190525061290682612331565b8160028151811061291357fe5b602002602001018190525061292a6119a782612331565b519b9a5050505050505050505050565b8051600090602080820490601f83010483612953612e95565b905060005b838110156129a45761299a604051806040016040528061297785612a2e565b815260200161256a612995856020028c612f0890919063ffffffff16565b6122b3565b9150600101612958565b50818310156129ff5760006129c387601f19870163ffffffff612f0816565b905083602002856020030360080281901b90506129fb60405180604001604052806129ed85612a2e565b815260200161256a846122b3565b9150505b612a246040518060400160405280612a16876122b3565b815260200161256a84612a2e565b9695505050505050565b612a36612f24565b604080516080808201835284825282519081018352600080825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191612a9b565b612a88612f24565b815260200190600190039081612a805790505b508152600260209091015292915050565b6040805160038082526080820190925260009160609190816020015b612ad0612f24565b815260200190600190039081612ac8575050805190915060005b81811015612b2257848160038110612afe57fe5b6020020151838281518110612b0f57fe5b6020908102919091010152600101612aea565b50611c7b82612cd4565b6000805460025460018054604080516335e1e69160e11b81526001600160a01b0394851660048201529184166024830152604482019290925290519190921692636bc3cd22926064808201939182900301818387803b158015612b8e57600080fd5b505af1158015611a0e573d6000803e3d6000fd5b6000805460018054600254604080516335e1e69160e11b81526001600160a01b039384166004820152918316602483015260448201939093529151921692636bc3cd229260648084019382900301818387803b158015612b8e57600080fd5b6008101590565b60408051602080820193909352815180820384018152908201909152805191012090565b60008315612c86575060408051600160f81b6020808301919091526001600160f81b031960f888901b1660218301526022820185905260428083018590528351808403909101815260629092019092528051910120611c7b565b5060408051600160f81b6020808301919091526001600160f81b031960f888901b16602183015260228083018590528351808403909101815260429092019092528051910120949350505050565b6000600882511115612d24576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e8eae0d8ca40d8cadccee8d60631b604482015290519081900360640190fd5b60608251604051908082528060200260200182016040528015612d51578160200160208202803883390190505b50805190915060005b81811015612dad57612d6a612f52565b612d86868381518110612d7957fe5b60200260200101516123e1565b90508060000151848381518110612d9957fe5b602090810291909101015250600101612d5a565b508351600360ff160182604051602001808360ff1660ff1660f81b8152600101828051906020019060200280838360005b83811015612df6578181015183820152602001612dde565b50505050905001925050506040516020818303038152906040528051906020012092505050919050565b60408051600280825260608281019093526000929190816020015b612e43612f24565b815260200190600190039081612e3b575050805190915060005b81811015612b2257848160028110612e7157fe5b6020020151838281518110612e8257fe5b6020908102919091010152600101612e5d565b6040805160008082526020808301808552600360f81b948401948552835192946003938593919260418501929091028083838a5b83811015612ee1578181015183820152602001612ec9565b50505050905001925050506040516020818303038152906040528051906020012091505090565b60008160200183511015612f1b57600080fd5b50016020015190565b604051806080016040528060008152602001612f3e612f64565b815260606020820152600060409091015290565b60408051602081019091526000815290565b6040805160808101825260008082526020820181905291810182905260608101919091529056fea265627a7a723158206bb175633c15cc81ea9349b4fcadbabae35ab0edc9ab33139339c7d1ef5a7b4764736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 85, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b5061115f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806302ad1e4e1461005c57806337423267146100a057806379a9ad8514610145578063ced5c1bf146101f7578063df9ce01b146101ff575b600080fd5b61009e600480360360a081101561007257600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135610222565b005b61009e600480360360408110156100b657600080fd5b8101906020810181356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184602083028401116401000000008311171561010557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610237915050565b61009e6004803603608081101561015b57600080fd5b8135919081019060408101602082013564010000000081111561017d57600080fd5b82018360208201111561018f57600080fd5b803590602001918460018302840111640100000000831117156101b157600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050823593505050602001356105f9565b61009e6108ba565b61009e6004803603604081101561021557600080fd5b508035906020013561099a565b61022e85858585610b66565b60065550505050565b60055460ff16600281111561024857fe5b600114604051806040016040528060098152602001684249535f535441544560b81b815250906102f65760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156102bb5781810151838201526020016102a3565b50505050905090810190601f1680156102e85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060035461030343610c81565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b815250906103765760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b031633146103f25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b506000600183510390506104366104318460008151811061040f57fe5b602002602001015185848151811061042357fe5b602002602001015185610c88565b610cbf565b600182116104755760405162461bcd60e51b815260040180806020018281038252602181526020018061110a6021913960400191505060405180910390fd5b6060816040519080825280602002602001820160405280156104a1578160200160208202803883390190505b5090506104e0846000815181106104b457fe5b6020026020010151856001815181106104c957fe5b60200260200101516104db8686610d31565b610c88565b816000815181106104ed57fe5b602090810291909101015260015b8281101561055a5761053b85828151811061051257fe5b602002602001015186836001018151811061052957fe5b60200260200101516104db8787610d4f565b82828151811061054757fe5b60209081029190910101526001016104fb565b5061056481610d62565b61056c610d71565b7f6ccb624e36453fb82f1a793715d74763283e458adc397e1f7d73dcdf604afbb184846003546040518080602001848152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156105de5781810151838201526020016105c6565b5050505090500194505050505060405180910390a150505050565b60055460ff16600281111561060a57fe5b60021460405180604001604052806009815260200168434f4e5f535441544560b81b8152509061067b5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b5060035461068843610c81565b11156040518060400160405280600c81526020016b434f4e5f444541444c494e4560a01b815250906106fb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b5060025460408051808201909152600a81526921a7a72fa9a2a72222a960b11b6020820152906001600160a01b031633146107775760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b5060065482146040518060400160405280600881526020016721a7a72fa82922ab60c11b815250906107ea5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b506107fa83838387600101610d8e565b6040518060400160405280600981526020016821a7a72fa82927a7a360b91b815250906108685760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b506006819055610876610e8f565b60035460408051868152602081019290925280517f1e1c1e4e68a25c69a078a396e73975691c071d69ef789015dc16a562957804e49281900390910190a150505050565b6003546108c643610c81565b11610918576040805162461bcd60e51b815260206004820152601760248201527f446561646c696e65206861736e27742065787069726564000000000000000000604482015290519081900360640190fd5b600160055460ff16600281111561092b57fe5b1415610967576040517f2b92a4b014281aa2424baba9ea60bf4f26833d1c1fbd873e51cd1a6caeef48f090600090a1610962610ea2565b610998565b6040517f4e1f1f06cf69d199fcdb4d87a5a92d5248ca6b540e9fc2d3698927c5002a236a90600090a1610998610ead565b565b60055460ff1660028111156109ab57fe5b600114604051806040016040528060098152602001684249535f535441544560b81b81525090610a1c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b50600354610a2943610c81565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b81525090610a9c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b03163314610b185760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b50610b3161043183610b2a8585610eb5565b6001610c88565b6040517f117efdf1fdd8be5a6ff0fb3c32333d7033bbd9523924bd0d9ca28f43540516f590600090a1610b62610ead565b5050565b600060055460ff166002811115610b7957fe5b146040518060400160405280600f81526020016e4348414c5f494e49545f535441544560881b81525090610bee5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b50600080546001600160a01b038681166001600160a01b03199283161790925560018054868416908316178155600280549386169390921692909217905560048290556005805460ff19169091179055610c46610ee1565b60035460408051918252517fe070f23072cbc6c0fc7253b8d0120649d5f9d6e19a8aeab79eb50aa6360bcc679181900360200190a150505050565b6103e80290565b6040805160208082019590955280820193909352606080840192909252805180840390920182526080909201909152805191012090565b6006548114604051806040016040528060088152602001672124a9afa82922ab60c11b81525090610b625760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156102bb5781810151838201526020016102a3565b6000818381610d3c57fe5b06828481610d4657fe5b04019392505050565b6000818381610d5a57fe5b049392505050565b610d6b81610ef3565b60065550565b600580546002919060ff19166001835b0217905550610998610ee1565b600080838160205b88518111610e81578089015193506020818a510360200181610db457fe5b0491505b600082118015610dcb5750600286066001145b8015610dd957508160020a86115b15610dec57600286046001019550610db8565b60028606610e37578383604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925060028681610e2f57fe5b049550610e79565b8284604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925060028681610e7257fe5b0460010195505b602001610d96565b505090941495945050505050565b600580546001919060ff19168280610d81565b610eaa611031565b33ff5b610eaa6110aa565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b600454610eed43610c81565b01600355565b6000815b6001815111156110145760606002825160010181610f1157fe5b04604051908082528060200260200182016040528015610f3b578160200160208202803883390190505b50905060005b815181101561100c578251816002026001011015610fd457828160020281518110610f6857fe5b6020026020010151838260020260010181518110610f8257fe5b6020026020010151604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120828281518110610fc357fe5b602002602001018181525050611004565b828160020281518110610fe357fe5b6020026020010151828281518110610ff757fe5b6020026020010181815250505b600101610f41565b509050610ef7565b8060008151811061102157fe5b6020026020010151915050919050565b60008054600254600154604080516335e1e69160e11b81526001600160a01b039384166004820152918316602483015260448201859052519190921692636bc3cd22926064808201939182900301818387803b15801561109057600080fd5b505af11580156110a4573d6000803e3d6000fd5b50505050565b60008054600154600254604080516335e1e69160e11b81526001600160a01b039384166004820152918316602483015260448201859052519190921692636bc3cd22926064808201939182900301818387803b15801561109057600080fdfe43616e27742062697365637420636861696e206f66206c657373207468616e2032a265627a7a7231582048dfa937a3d2aa73956334be7751f43a34009411a7fa43a6077f7230280fb3d564736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 94, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b50611d6c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806302ad1e4e1461005c57806379a9ad85146100a05780638827cdc614610150578063ba2a231114610261578063ced5c1bf1461054b575b600080fd5b61009e600480360360a081101561007257600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135610553565b005b61009e600480360360808110156100b657600080fd5b81359190810190604081016020820135600160201b8111156100d757600080fd5b8201836020820111156100e957600080fd5b803590602001918460018302840111600160201b8311171561010a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350505060200135610568565b61009e600480360361018081101561016757600080fd5b6040805180820182528335936020810135938101929091608083019180840190600290839083908082843760009201919091525091948335946020850135151594604081013594506060810135935060808101359260a08201359267ffffffffffffffff60c0840135169261010081019060e00135600160201b8111156101ed57600080fd5b8201836020820111156101ff57600080fd5b803590602001918460018302840111600160201b8311171561022057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610866945050505050565b61009e600480360361012081101561027857600080fd5b60408051808201825283359392830192916060830191906020840190600290839083908082843760009201919091525091949392602081019250359050600160201b8111156102c657600080fd5b8201836020820111156102d857600080fd5b803590602001918460208302840111600160201b831117156102f957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561034857600080fd5b82018360208201111561035a57600080fd5b803590602001918460208302840111600160201b8311171561037b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103ca57600080fd5b8201836020820111156103dc57600080fd5b803590602001918460208302840111600160201b831117156103fd57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561044c57600080fd5b82018360208201111561045e57600080fd5b803590602001918460208302840111600160201b8311171561047f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104ce57600080fd5b8201836020820111156104e057600080fd5b803590602001918460208302840111600160201b8311171561050157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505050903567ffffffffffffffff169150610c339050565b61009e610e08565b61055f85858585610ee8565b60065550505050565b60055460ff16600281111561057957fe5b60021460405180604001604052806009815260200168434f4e5f535441544560b81b815250906106275760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156105ec5781810151838201526020016105d4565b50505050905090810190601f1680156106195780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060035461063443611003565b11156040518060400160405280600c81526020016b434f4e5f444541444c494e4560a01b815250906106a75760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5060025460408051808201909152600a81526921a7a72fa9a2a72222a960b11b6020820152906001600160a01b031633146107235760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5060065482146040518060400160405280600881526020016721a7a72fa82922ab60c11b815250906107965760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b506107a68383838760010161100a565b6040518060400160405280600981526020016821a7a72fa82927a7a360b91b815250906108145760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b50600681905561082261110b565b60035460408051868152602081019290925280517f1e1c1e4e68a25c69a078a396e73975691c071d69ef789015dc16a562957804e49281900390910190a150505050565b60055460ff16600281111561087757fe5b600114604051806040016040528060098152602001684249535f535441544560b81b815250906108e85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b506003546108f543611003565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b815250906109685760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b031633146109e45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5060006109f28c8b8d611127565b9050610a16610a11600183610a0c8d8d898e8e8e8e611182565b6111e5565b61122d565b60007369D2c1c5A446475A4C4a58Feac063510001F2A73630b1cb7878e8d8f8e8e8e8e8e8e8e8e6040518c63ffffffff1660e01b8152600401808c81526020018b600260200280838360005b83811015610a7a578181015183820152602001610a62565b505050509050018a8152602001898152602001881515151581526020018781526020018681526020018581526020018481526020018367ffffffffffffffff1667ffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610b02578181015183820152602001610aea565b50505050905090810190601f168015610b2f5780820380516001836020036101000a031916815260200191505b509c5050505050505050505050505060206040518083038186803b158015610b5657600080fd5b505af4158015610b6a573d6000803e3d6000fd5b505050506040513d6020811015610b8057600080fd5b505160408051808201909152600981526827a9a82fa82927a7a360b91b60208201529091508115610bf25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b506040517f117efdf1fdd8be5a6ff0fb3c32333d7033bbd9523924bd0d9ca28f43540516f590600090a1610c246112a3565b50505050505050505050505050565b60055460ff166002811115610c4457fe5b600114604051806040016040528060098152602001684249535f535441544560b81b81525090610cb55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b50600354610cc243611003565b11156040518060400160405280600c81526020016b4249535f444541444c494e4560a01b81525090610d355760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5060015460408051808201909152600a8152692124a9afa9a2a72222a960b11b6020820152906001600160a01b03163314610db15760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b50610dfe6040518061010001604052808a81526020018981526020018881526020018781526020018681526020018581526020018481526020018367ffffffffffffffff168152506112ae565b5050505050505050565b600354610e1443611003565b11610e66576040805162461bcd60e51b815260206004820152601760248201527f446561646c696e65206861736e27742065787069726564000000000000000000604482015290519081900360640190fd5b600160055460ff166002811115610e7957fe5b1415610eb5576040517f2b92a4b014281aa2424baba9ea60bf4f26833d1c1fbd873e51cd1a6caeef48f090600090a1610eb0611a3d565b610ee6565b6040517f4e1f1f06cf69d199fcdb4d87a5a92d5248ca6b540e9fc2d3698927c5002a236a90600090a1610ee66112a3565b565b600060055460ff166002811115610efb57fe5b146040518060400160405280600f81526020016e4348414c5f494e49545f535441544560881b81525090610f705760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b50600080546001600160a01b038681166001600160a01b03199283161790925560018054868416908316178155600280549386169390921692909217905560048290556005805460ff19169091179055610fc8611a45565b60035460408051918252517fe070f23072cbc6c0fc7253b8d0120649d5f9d6e19a8aeab79eb50aa6360bcc679181900360200190a150505050565b6103e80290565b600080838160205b885181116110fd578089015193506020818a51036020018161103057fe5b0491505b6000821180156110475750600286066001145b801561105557508160020a86115b1561106857600286046001019550611034565b600286066110b35783836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250600286816110ab57fe5b0495506110f5565b82846040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250600286816110ee57fe5b0460010195505b602001611012565b505090941495945050505050565b600580546001919060ff191682805b0217905550610ee6611a45565b815160209283015160408051808601969096526fffffffffffffffffffffffffffffffff19608093841b81168783015291831b9091166050860152606080860193909352805180860390930183529301909252815191012090565b6040805160208082019990995296151560f81b8782015260c09590951b6001600160c01b031916604187015260498601939093526069850191909152608984015260a9808401919091528151808403909101815260c99092019052805191012090565b6040805160c09490941b6001600160c01b0319166020808601919091526028850193909352604880850192909252805180850390920182526068909301909252815191012090565b6006548114604051806040016040528060088152602001672124a9afa82922ab60c11b8152509061129f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5050565b6112ab611a57565b33ff5b6000600182604001515103905081606001515181146040518060400160405280600a8152602001692124a9afa4a7282622a760b11b815250906113325760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b5081608001515181600101146040518060400160405280600a8152602001692124a9afa4a7282622a760b11b815250906113ad5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b508160a001515181600101146040518060400160405280600a8152602001692124a9afa4a7282622a760b11b815250906114285760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b508160c001515181146040518060400160405280600a8152602001692124a9afa4a7282622a760b11b815250906114a05760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156105ec5781810151838201526020016105d4565b50600080805b838110156114f4578460c0015181815181106114be57fe5b60200260200101518301925081806114ea5750846060015181815181106114e157fe5b60200260200101515b91506001016114a6565b506000611522856040015160008151811061150b57fe5b602002602001015186602001518760000151611127565b905060006115aa8660400151868151811061153957fe5b60200260200101518486896080015160008151811061155457fe5b60200260200101518a608001518a8151811061156c57fe5b60200260200101518b60a0015160008151811061158557fe5b60200260200101518c60a001518c8151811061159d57fe5b6020026020010151611182565b90506115be610a118760e0015184846111e5565b6060856040519080825280602002602001820160405280156115ea578160200160208202803883390190505b509050611697876040015160018151811061160157fe5b6020026020010151886060015160008151811061161a57fe5b60200260200101518960c0015160008151811061163357fe5b60200260200101518a6080015160008151811061164c57fe5b60200260200101518b6080015160018151811061166557fe5b60200260200101518c60a0015160008151811061167e57fe5b60200260200101518d60a0015160018151811061159d57fe5b91506116eb6116b48860e0015167ffffffffffffffff1688611ad3565b63ffffffff166116e589604001516000815181106116ce57fe5b60200260200101518a602001518b60000151611127565b846111e5565b816000815181106116f857fe5b602090810291909101015260015b86811015611857578760600151600182038151811061172157fe5b60200260200101511561173957611736611af1565b88525b6117e58860400151826001018151811061174f57fe5b60200260200101518960600151838151811061176757fe5b60200260200101518a60c00151848151811061177f57fe5b60200260200101518b60800151858151811061179757fe5b60200260200101518c6080015186600101815181106117b257fe5b60200260200101518d60a0015187815181106117ca57fe5b60200260200101518e60a00151886001018151811061159d57fe5b92506118386118028960e0015167ffffffffffffffff1689611b64565b63ffffffff166118328a60400151848151811061181b57fe5b60200260200101518b602001518c60000151611127565b856111e5565b82828151811061184457fe5b6020908102919091010152600101611706565b5061186181611b77565b611869611b86565b7f99a5d600237469c778df4f1eb561cbc9eada42285a37b35e762776647ab1ee478760400151886060015189608001518a60a001518b60c001518c60e001516003546040518080602001806020018060200180602001806020018867ffffffffffffffff1667ffffffffffffffff16815260200187815260200186810386528d818151815260200191508051906020019060200280838360005b8381101561191b578181015183820152602001611903565b5050505090500186810385528c818151815260200191508051906020019060200280838360005b8381101561195a578181015183820152602001611942565b5050505090500186810384528b818151815260200191508051906020019060200280838360005b83811015611999578181015183820152602001611981565b5050505090500186810383528a818151815260200191508051906020019060200280838360005b838110156119d85781810151838201526020016119c0565b50505050905001868103825289818151815260200191508051906020019060200280838360005b83811015611a175781810151838201526020016119ff565b505050509050019c5050505050505050505050505060405180910390a150505050505050565b6112ab611b9a565b600454611a5143611003565b01600355565b6000805460015460028054604080516335e1e69160e11b81526001600160a01b0394851660048201529184166024830152604482019290925290519190921692636bc3cd22926064808201939182900301818387803b158015611ab957600080fd5b505af1158015611acd573d6000803e3d6000fd5b50505050565b6000818381611ade57fe5b06828481611ae857fe5b04019392505050565b6040805160008082526020808301808552600360f81b948401948552835192946003938593919260418501929091028083838a5b83811015611b3d578181015183820152602001611b25565b50505050905001925050506040516020818303038152906040528051906020012091505090565b6000818381611b6f57fe5b049392505050565b611b8081611bf9565b60065550565b600580546002919060ff191660018361111a565b6000805460028054600154604080516335e1e69160e11b81526001600160a01b039384166004820152918316602483015260448201939093529151921692636bc3cd229260648084019382900301818387803b158015611ab957600080fd5b6000815b600181511115611d1a5760606002825160010181611c1757fe5b04604051908082528060200260200182016040528015611c41578160200160208202803883390190505b50905060005b8151811015611d12578251816002026001011015611cda57828160020281518110611c6e57fe5b6020026020010151838260020260010181518110611c8857fe5b6020026020010151604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120828281518110611cc957fe5b602002602001018181525050611d0a565b828160020281518110611ce957fe5b6020026020010151828281518110611cfd57fe5b6020026020010181815250505b600101611c47565b509050611bfd565b80600081518110611d2757fe5b602002602001015191505091905056fea265627a7a7231582009cb31f25d5eb386aa351e7dc85edce1e84902f817f414f85d90c893ffb3083e64736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 106, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b506040516107423803806107428339818101604052606081101561003357600080fd5b5080516020820151604090920151600080546001600160a01b039384166001600160a01b03199182161790915560018054948416948216949094179093556002805492909116919092161790556106b38061008f6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063729406c81461005c578063865da1c2146100ae5780639b5f4dfc146100f0578063e252f79a146100f8578063f089f1c214610100575b600080fd5b6100926004803603606081101561007257600080fd5b506001600160a01b03813581169160208101359091169060400135610108565b604080516001600160a01b039092168252519081900360200190f35b610092600480360360a08110156100c457600080fd5b506001600160a01b0381358116916020810135909116906040810135906060810135906080013561019f565b610092610246565b610092610255565b610092610264565b60006001600160f81b03193061011e8686610273565b61012f61012a866102c0565b6103bb565b60405160200180856001600160f81b0319166001600160f81b0319168152600101846001600160a01b03166001600160a01b031660601b81526014018381526020018281526020019450505050506040516020818303038152906040528051906020012060001c90509392505050565b6000806101ab836102c0565b905060006101b8826104c5565b604080516301568f2760e11b81523360048201526001600160a01b038b811660248301528a81166044830152606482018a9052608482018990529151929350908316916302ad1e4e9160a48082019260009290919082900301818387803b15801561022257600080fd5b505af1158015610236573d6000803e3d6000fd5b50929a9950505050505050505050565b6002546001600160a01b031681565b6000546001600160a01b031681565b6001546001600160a01b031681565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b1660348201523390931b60488401528051603c818503018152605c9093019052815191012090565b6000816102d957506001546001600160a01b03166103b6565b60018214156102f457506000546001600160a01b03166103b6565b600282141561030f57506002546001600160a01b03166103b6565b60408051808201909152600c81526b494e56414c49445f5459504560a01b602082015260405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561037b578181015183820152602001610363565b50505050905090810190601f1680156103a85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b919050565b60006060604051806020016103cf906105e2565b601f1982820381018352601f9091011660408181526001600160a01b038616602083810191909152815180840382018152828401909252835191926060019182918501908083835b602083106104365780518252601f199092019160209182019101610417565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b6020831061047e5780518252601f19909201916020918201910161045f565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290508080519060200120915050919050565b60006060604051806020016104d9906105e2565b601f1982820381018352601f9091011660408181526001600160a01b038616602083810191909152815180840382018152828401909252835191926060019182918501908083835b602083106105405780518252601f199092019160209182019101610521565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106105885780518252601f199092019160209182019101610569565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529050806020018151808234f09350836105da573d6000803e3d6000fd5b505050919050565b6090806105ef8339019056fe6080604052348015600f57600080fd5b506040516090380380609083398181016040526020811015602f57600080fd5b50516040805169363d3d373d3d3d363d7360b01b6020828101919091526001600160601b0319606085901b16602a8301526e5af43d82803e903d91602b57fd5bf360881b603e8301528251602d81840381018252604d9093019093528201f3fea265627a7a72315820f16930c87603389d71c3864f7a1f37f8336ae80058e714705171c4ea3938445564736f6c634300050f0032000000000000000000000000b5475fb23bef93853d3be0972b8ac34b5852ccf1000000000000000000000000965c9e7ef13c1ed8f07ca9959f85e1c8e94b6a9e0000000000000000000000005aa7298a865b439a7307378366cf9cc75752d6a6" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 118, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b50615007806100206000396000f3fe60806040526004361061014b5760003560e01c8063badb3f14116100b6578063d684f94b1161006f578063d684f94b14610dc8578063dbad0a3914610e94578063e0620d6414610f5f578063f75e48661461101d578063fcfd8d3f14611050578063ffa1ad74146113065761014b565b8063badb3f1414610c07578063bbc2cc0014610caa578063c581831714610cef578063cfa8070714610d6d578063d16c305d14610d82578063d489113a14610db35761014b565b806365f7f80d1161010857806365f7f80d146108aa5780636bc3cd22146108d157806379d1120b146109145780637cfaaf671461099a578063b7ff920e14610a15578063bac5963f14610a485761014b565b8063113ec9d8146101505780631a072771146101dd578063335540321461072857806357ca6d1b146108085780635dbaf68b146108465780636177fd1814610877575b600080fd5b34801561015c57600080fd5b506101db6004803603604081101561017357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561019d57600080fd5b8201836020820111156101af57600080fd5b803590602001918460208302840111600160201b831117156101d057600080fd5b509092509050611390565b005b3480156101e957600080fd5b506101db600480360361016081101561020157600080fd5b81359190810190604081016020820135600160201b81111561022257600080fd5b82018360208201111561023457600080fd5b803590602001918460208302840111600160201b8311171561025557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156102a457600080fd5b8201836020820111156102b657600080fd5b803590602001918460208302840111600160201b831117156102d757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561032657600080fd5b82018360208201111561033857600080fd5b803590602001918460208302840111600160201b8311171561035957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103a857600080fd5b8201836020820111156103ba57600080fd5b803590602001918460208302840111600160201b831117156103db57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561042a57600080fd5b82018360208201111561043c57600080fd5b803590602001918460208302840111600160201b8311171561045d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104ac57600080fd5b8201836020820111156104be57600080fd5b803590602001918460208302840111600160201b831117156104df57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561052e57600080fd5b82018360208201111561054057600080fd5b803590602001918460018302840111600160201b8311171561056157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156105b357600080fd5b8201836020820111156105c557600080fd5b803590602001918460208302840111600160201b831117156105e657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561063557600080fd5b82018360208201111561064757600080fd5b803590602001918460208302840111600160201b8311171561066857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156106b757600080fd5b8201836020820111156106c957600080fd5b803590602001918460208302840111600160201b831117156106ea57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611481945050505050565b34801561073457600080fd5b506101db6004803603608081101561074b57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561077a57600080fd5b82018360208201111561078c57600080fd5b803590602001918460208302840111600160201b831117156107ad57600080fd5b919390929091602081019035600160201b8111156107ca57600080fd5b8201836020820111156107dc57600080fd5b803590602001918460208302840111600160201b831117156107fd57600080fd5b5090925090506114e2565b34801561081457600080fd5b506108326004803603602081101561082b57600080fd5b503561163a565b604080519115158252519081900360200190f35b34801561085257600080fd5b5061085b611652565b604080516001600160a01b039092168252519081900360200190f35b34801561088357600080fd5b506108326004803603602081101561089a57600080fd5b50356001600160a01b0316611661565b3480156108b657600080fd5b506108bf61167e565b60408051918252519081900360200190f35b3480156108dd57600080fd5b506101db600480360360608110156108f457600080fd5b506001600160a01b03813581169160208101359091169060400135611684565b34801561092057600080fd5b506101db600480360361012081101561093857600080fd5b508035906001600160801b036020820135811691604081013582169167ffffffffffffffff606083013581169260808101359091169160a082013516906001600160a01b0360c082013581169160e081013582169161010090910135166117e0565b3480156109a657600080fd5b506101db600480360360208110156109bd57600080fd5b810190602081018135600160201b8111156109d757600080fd5b8201836020820111156109e957600080fd5b803590602001918460208302840111600160201b83111715610a0a57600080fd5b509092509050611822565b348015610a2157600080fd5b5061085b60048036036020811015610a3857600080fd5b50356001600160a01b0316611863565b348015610a5457600080fd5b506101db60048036036101a0811015610a6c57600080fd5b6040805180820182526001600160a01b0384358116946020810135909116938382013593606083013593918301929160c083019160808401906002908390839080828437600092019190915250506040805180820182529295949381810193925090600290839083908082843760009201919091525091949392602081019250359050600160201b811115610b0057600080fd5b820183602082011115610b1257600080fd5b803590602001918460208302840111600160201b83111715610b3357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610b8257600080fd5b820183602082011115610b9457600080fd5b803590602001918460208302840111600160201b83111715610bb557600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050823593505050602081013590604001356001600160801b031661187e565b348015610c1357600080fd5b506101db600480360360c0811015610c2a57600080fd5b6001600160a01b03823516916020810135916040820135916060810135916080820135919081019060c0810160a0820135600160201b811115610c6c57600080fd5b820183602082011115610c7e57600080fd5b803590602001918460208302840111600160201b83111715610c9f57600080fd5b509092509050611e24565b348015610cb657600080fd5b50610cbf611f9f565b60408051948552602085019390935267ffffffffffffffff91821684840152166060830152519081900360800190f35b6101db60048036036040811015610d0557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610d2f57600080fd5b820183602082011115610d4157600080fd5b803590602001918460018302840111600160201b83111715610d6257600080fd5b509092509050611fc0565b348015610d7957600080fd5b506101db61213a565b348015610d8e57600080fd5b50610d976121b9565b604080516001600160801b039092168252519081900360200190f35b348015610dbf57600080fd5b5061085b6121c8565b348015610dd457600080fd5b506101db6004803603610260811015610dec57600080fd5b610120820135906101408301359063ffffffff610160850135169067ffffffffffffffff6101808601358116916101a08701916101e0880135916102008901351515916102208a013516908901896102608101610240820135600160201b811115610e5657600080fd5b820183602082011115610e6857600080fd5b803590602001918460208302840111600160201b83111715610e8957600080fd5b5090925090506121d7565b348015610ea057600080fd5b506101db60048036036040811015610eb757600080fd5b810190602081018135600160201b811115610ed157600080fd5b820183602082011115610ee357600080fd5b803590602001918460208302840111600160201b83111715610f0457600080fd5b919390929091602081019035600160201b811115610f2157600080fd5b820183602082011115610f3357600080fd5b803590602001918460208302840111600160201b83111715610f5457600080fd5b509092509050612406565b6101db60048036036040811015610f7557600080fd5b810190602081018135600160201b811115610f8f57600080fd5b820183602082011115610fa157600080fd5b803590602001918460208302840111600160201b83111715610fc257600080fd5b919390929091602081019035600160201b811115610fdf57600080fd5b820183602082011115610ff157600080fd5b803590602001918460208302840111600160201b8311171561101257600080fd5b509092509050612517565b34801561102957600080fd5b506101db6004803603602081101561104057600080fd5b50356001600160a01b031661262a565b34801561105c57600080fd5b506101db600480360360a081101561107357600080fd5b810190602081018135600160201b81111561108d57600080fd5b82018360208201111561109f57600080fd5b803590602001918460208302840111600160201b831117156110c057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561110f57600080fd5b82018360208201111561112157600080fd5b803590602001918460208302840111600160201b8311171561114257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561119157600080fd5b8201836020820111156111a357600080fd5b803590602001918460208302840111600160201b831117156111c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561121357600080fd5b82018360208201111561122557600080fd5b803590602001918460208302840111600160201b8311171561124657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561129557600080fd5b8201836020820111156112a757600080fd5b803590602001918460208302840111600160201b831117156112c857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506126b3945050505050565b34801561131257600080fd5b5061131b612951565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561135557818101518382015260200161133d565b50505050905090810190601f1680156113825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051808201909152600e81526d0a48a86ac9e9888be988a9c8ea8960931b60208201528161143e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114035781810151838201526020016113eb565b50505050905090810190601f1680156114305780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5061147c8383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061296e92505050565b505050565b6114d56040518061016001604052808d81526020018c81526020018b81526020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815250612a0d565b5050505050505050505050565b60006114ed33612e6f565b9050828260008181106114fc57fe5b905060200201358585600081811061151057fe5b9050602002013514158015611567575061152861167e565b61156587878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b145b80156115ae5750806115ac87858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b145b604051806040016040528060148152602001732922a1a7ab2fa1a7a7232624a1aa2fa82927a7a360611b815250906116275760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5061163187612f16565b50505050505050565b60008181526004602052604090205460ff165b919050565b6006546001600160a01b031681565b6001600160a01b0316600090815260086020526040902054151590565b60055490565b336000908152600a6020908152604091829020548251808401909352600f83526e2922a9afa1a420a62fa9a2a72222a960891b9183019190915260ff1661170c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50336000908152600a60205260408120805460ff1916905561172d84612f9f565b6007546040519192506001600160a01b0386169160026001600160801b039283160490911680156108fc02916000818181858888f19350505050158015611778573d6000803e3d6000fd5b5060018101805460ff60801b1916905561179183613029565b604080513381526001600160a01b03808716602083015285168183015290517f468aa7d460319b17466ca163bca353a0c62fff0d7d0fa287f634ef305d946f299181900360600190a150505050565b6117ee89898989898661306a565b6117f8848361315e565b5050600b80546001600160a01b0319166001600160a01b0392909216919091179055505050505050565b61185f3383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061296e92505050565b5050565b600d602052600090815260409020546001600160a01b031681565b60006118898c612f9f565b905060006118968c612f9f565b60018301549091508a906118b2906001600160801b0316613294565b106040518060400160405280600d81526020016c53544b315f444541444c494e4560981b815250906119255760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060018101548a9061193f906001600160801b0316613294565b106040518060400160405280600d81526020016c53544b325f444541444c494e4560981b815250906119b25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600182015460408051808201909152600c81526b14d512cc57d25397d0d2105360a21b602082015290600160801b900460ff1615611a325760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600181015460408051808201909152600c81526b14d512cc57d25397d0d2105360a21b602082015290600160801b900460ff1615611ab25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506020808a01518a5160408051808201909152600a8152692a2ca822afa7a92222a960b11b9381019390935211611b2a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b508154611b52611b4c8d8d898e600060200201518e60005b602002015161329b565b89612eff565b146040518060400160405280600c81526020016b20a9a9a2a92a2fa82927a7a360a11b81525090611bc45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b508054611bf5611bef8d8d611be2896001600160801b038a16613303565b60208f01518e6001611b42565b88612eff565b146040518060400160405280600a81526020016921a420a62fa82927a7a360b11b81525090611c655760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060018260010160106101000a81548160ff02191690831515021790555060018160010160106101000a81548160ff0219169083151502179055506000600660009054906101000a90046001600160a01b03166001600160a01b031663865da1c28f8f87898f600160028110611cd757fe5b60200201516040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200195505050505050602060405180830381600087803b158015611d5b57600080fd5b505af1158015611d6f573d6000803e3d6000fd5b505050506040513d6020811015611d8557600080fd5b50516001600160a01b0381166000908152600a60205260409020805460ff191660019081179091559091507f6c69257ddf620994c6fb9e5304db0e5563db3765bee033ddd61b6a1caa7d043f908f908f908d9060209081029190910151604080516001600160a01b0395861681529385169284019290925282820152918416606082015290519081900360800190a15050505050505050505050505050565b6000611e2f33612e6f565b90506000611e40828989898961329b565b90506000611e8182868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b9050611e8c8161163a565b604051806040016040528060138152602001722922a1a7ab2fa222a0a22624a722afa622a0a360691b81525090611f045760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50611f0e89613294565b431015604051806040016040528060138152602001725245434f565f444541444c494e455f54494d4560681b81525090611f895760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50611f938a612f16565b50505050505050505050565b60015460025460035467ffffffffffffffff80821691600160401b90041684565b336000908152600c60205260409020546001600160a01b0316806120155760405162461bcd60e51b8152600401808060200182810382526029815260200180614faa6029913960400191505060405180910390fd5b60008054604080516396588a2760e01b81526001600160a01b0385811660048301528881166024830152915191909216926396588a279234926044808301939282900301818588803b15801561206a57600080fd5b505af115801561207e573d6000803e3d6000fd5b50506000546040516384cb799760e01b81526001600160a01b03868116600483019081528a821660248401523460448401819052608060648501908152608485018b90529290941696506384cb799795508794508a93928a928a929160a401848480828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b15801561211c57600080fd5b505af1158015612130573d6000803e3d6000fd5b5050505050505050565b600b5460408051808201909152600a81526927a7262cafa7aba722a960b11b6020820152906001600160a01b031633146121b55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5033ff5b6007546001600160801b031690565b6000546001600160a01b031681565b6000806123256040518061022001604052808f6000600981106121f657fe5b602002013581526020018f60016009811061220d57fe5b602002013581526020018e81526020018f60026009811061222a57fe5b602002013581526020018d81526020018f60036009811061224757fe5b602002013581526020018c63ffffffff1681526020018b67ffffffffffffffff1681526020018a600280602002604051908101604052809291908260026020028082843760009201919091525050508152602081018a90526040018f6004602002013581526020018f6005600981106122bc57fe5b602002013581526020018f6006600981106122d357fe5b6020020135815260200188151581526020018767ffffffffffffffff1681526020018f60076009811061230257fe5b602002013581526020018f60086009811061231957fe5b6020020135905261332f565b91509150600061233433612e6f565b90508261237482878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b146040518060400160405280601181526020017026a0a5a2afa9aa20a5a2a92fa82927a7a360791b815250906123eb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506123f6338361385e565b5050505050505050505050505050565b600061241133612e6f565b9050600061245282878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b9050600061249382868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b905061249e8161163a565b6040518060400160405280600981526020016826a7ab22afa622a0a360b91b8152509061250c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50611631338361385e565b600061255d61252461167e565b868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b9050600061259e82858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b90506125a98161163a565b6040518060400160405280600a815260200169282620a1a2afa622a0a360b11b815250906126185760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50612622826138b7565b505050505050565b60003060405161263990614e09565b6001600160a01b03909116815260405190819003602001906000f080158015612666573d6000803e3d6000fd5b506001600160a01b039081166000818152600c602090815260408083208054959097166001600160a01b03199586168117909755958252600d905293909320805490911690921790915550565b84518351811480156126c55750808251145b61270f576040805162461bcd60e51b81526020600482015260166024820152750d2dce0eae840d8cadccee8d040dad2e6e8dac2e8c6d60531b604482015290519081900360640190fd5b600080805b8381101561294657600089828151811061272a57fe5b60200260200101519050600088838151811061274257fe5b602002602001015111801561276a5750600086838151811061276057fe5b6020026020010151115b6040518060400160405280600e81526020016d28292aa722afa82927a7a32622a760911b815250906127dd5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060008883815181106127ec57fe5b602002602001015185019050600087848151811061280657fe5b60200260200101518501905088858151811061281e57fe5b60200260200101518b878151811061283257fe5b602002602001015114158015612859575061284b61167e565b612857848b8885613a65565b145b6040518060400160405280600e81526020016d141495539157d0d3d391931250d560921b815250906128cc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060006128db848d8986613a65565b90506128e68161163a565b1561293757600081815260046020908152604091829020805460ff19169055815183815291517f3d3e2ada9638548d1bb115fd766ef675213d953efe8d433bbd8d6718f44909509281900390910190a15b50909450925050600101612714565b505050505050505050565b604051806040016040528060018152602001603160f81b81525081565b600061297933612e6f565b905061298361167e565b61298d8284612eff565b146040518060400160405280601081526020016f2922a1a7ab2fa820aa242fa82927a7a360811b81525090612a035760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5061147c83612f16565b60208101515160c08201515160a0830151518114612a2a57600080fd5b8083608001515114612a3b57600080fd5b8183604001515114612a4c57600080fd5b80820383606001515114612a5f57600080fd5b6000808080612a6c61167e565b875190915060005b87811015612b7057600089602001518281518110612a8e57fe5b6020026020010151905060006003821415612b1d5760008b60c001518981518110612ab557fe5b60200260200101519050612aee612ad18d60e001518984613acf565b8d608001518b81518110612ae157fe5b6020026020010151613303565b915080870196508b60a001518981518110612b0557fe5b60200260200101519450888060010199505050612b40565b8a606001518781518110612b2d57fe5b6020026020010151905086806001019750505b612b64858c604001518581518110612b5457fe5b602002602001015183858861329b565b94505050600101612a74565b508760e00151518314612bca576040805162461bcd60e51b815260206004820152601860248201527f4469646e2774207265616420616c6c206d657373616765730000000000000000604482015290519081900360640190fd5b87604001516001880381518110612bdd57fe5b6020026020010151612bee43613294565b101560405180604001604052806009815260200168434f4e465f54494d4560b81b81525090612c5e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506000612c97838a6040015160018b0381518110612c7857fe5b60200260200101518b61010001518c61012001518d6101400151613c23565b9050600081116040518060400160405280600f81526020016e21a7a7232fa420a9afa9aa20a5a2a960891b81525090612d115760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50612d1b83613ece565b6000805460e08b015160405163e4eb8c6360e01b81526020600482018181528351602484015283516001600160a01b039095169563e4eb8c639591938493604490910192908601918190849084905b83811015612d82578181015183820152602001612d6a565b50505050905090810190601f168015612daf5780820380516001836020036101000a031916815260200191505b5092505050600060405180830381600087803b158015612dce57600080fd5b505af1158015612de2573d6000803e3d6000fd5b50505050600086111561294657608089015160408051602080825283518183015283517fded5fa103431438087188a5f8c6a4c3ea90996bbd63be7b1b3fa0a425b37fdd59493839290830191818601910280838360005b83811015612e51578181015183820152602001612e39565b505050509050019250505060405180910390a1505050505050505050565b6001600160a01b0381166000908152600860209081526040808320548151808301909252600a82526924a72b2fa9aa20a5a2a960b11b9282019290925281612ef85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5092915050565b6000612f0f838360008551613a65565b9392505050565b612f1f81613029565b6007546040516001600160a01b038316916001600160801b031680156108fc02916000818181858888f19350505050158015612f5f573d6000803e3d6000fd5b50604080516001600160a01b038316815290517f953ab9eece73c907353307064109cf873462177a0e358e463fd89f5b206daa6c9181900360200190a150565b6001600160a01b038116600090815260086020908152604080832080548251808401909352600a83526924a72b2fa9aa20a5a2a960b11b9383019390935291612ef85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b6001600160a01b03166000908152600860205260408120908155600101805470ffffffffffffffffffffffffffffffffff1916905560098054600019019055565b600080546001600160a01b0319166001600160a01b03831617815561309887613091613f09565b6000613f7c565b905060006130a9818080808661329b565b6005819055600081815260046020908152604091829020805460ff191660019081179091556001600160801b03808c1690915589166002556003805467ffffffffffffffff898116600160401b026fffffffffffffffff000000000000000019918c1667ffffffffffffffff19909316929092171617905581518b815291519293507f4ac0014773275a3dfb58c58539631006301de41998cce7c4f8698d297c88bb2d92918290030190a15050505050505050565b60065460408051808201909152600a815269494e49545f545749434560b01b6020820152906001600160a01b0316156131d85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060408051808201909152600c81526b494e49545f4e4f4e5a45524f60a01b60208201526001600160a01b0382166132515760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600680546001600160a01b0319166001600160a01b0392909216919091179055600780546001600160801b0319166001600160801b0392909216919091179055565b6103e80290565b6040805160208082018490528183018790526060820186905260808083018690528351808403909101815260a08301845280519082012060c0830189905260e08084019190915283518084039091018152610100909201909252805191012095945050505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b600080600061334b846000015185602001518660400151613f7c565b90506000613372856060015186608001518760a001518860c0015163ffffffff168661329b565b905061337d8161163a565b6040518060400160405280600981526020016826a0a5a2afa622a0a360b91b815250906133eb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5084516133f790613fb3565b15801561340c5750845161340a90613fb9565b155b6040518060400160405280600881526020016726a0a5a2afa92aa760c11b815250906134795760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060035460e086015160408051808201909152600981526804d414b455f535445560bc1b60208201529167ffffffffffffffff908116911611156134fe5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506003546101008601518051600160401b90920467ffffffffffffffff169091016001600160801b031690600160200201516001600160801b0316111561354457600080fd5b613552856101000151613fbd565b604051806040016040528060098152602001684d414b455f54494d4560b81b815250906135c05760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5061012085015115806135d55750846101a001515b6040518060400160405280600d81526020016c4d414b455f4d4553534147455360981b815250906136475760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506000805460408051630220168160e01b8152306004820152815184936001600160a01b03169263022016819260248082019391829003018186803b15801561368f57600080fd5b505afa1580156136a3573d6000803e3d6000fd5b505050506040513d60408110156136b957600080fd5b508051602090910151604089015191935091506136dd90829063ffffffff613fed16565b87610120015111156040518060400160405280601081526020016f135052d157d35154d4d051d157d0d39560821b8152509061375a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506001546002546101c08901516000919067ffffffffffffffff168161377c57fe5b04905060008261378b43613294565b01905089608001518110156137a1575060808901515b810160006137b48b888489898d8a61402f565b905060006137c58c89858c89614080565b905060006137d78d8a868d8a8a6140df565b905060006137e68e8b87614169565b6000858152600460205260408082208054600160ff19918216811790925587845282842080548216831790558684528284208054821683179055848452828420805482169092179091558d8352912080549091169055905061384a8e8b8b8b6141ab565b989b50979950505050505050505050915091565b6001600160a01b0382166000818152600860209081526040918290208490558151928352820183905280517fbe690ac5fe353c094bcc6f187eeb841c0ca61b6edf32c142eadad655b7d173f49281900390910190a15050565b60078054604080518082019091529182526614d512d7d0535560ca1b60208301526001600160801b0316341461392e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5033600090815260086020908152604091829020548251808401909352600c83526b105314911657d4d51052d15160a21b91830191909152156139b25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50604080516060810182528281526001600160801b03438116602080840191825260008486018181523380835260088452918790209551865592516001958601805494511515600160801b0260ff60801b19929096166001600160801b031990951694909417169390931790915560098054909301909255825190815290810183905281517fcbafbb223ed21c82af9e2ad20cdfdf55d3263d06f9a65b3f70da613f32d81f88929181900390910190a150565b600084835b83811015613ac35781868281518110613a7f57fe5b602002602001015160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091508080600101915050613a6a565b5090505b949350505050565b825160009081908190819086860190811115613b23576040805162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b604482015290519081900360640190fd5b865b81811015613bc057613b3789826142d7565b919650909350905084613b8a576040805162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7574707574206d65737361676560501b604482015290519081900360640190fd5b83836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209350613b25565b8688018114613c16576040805162461bcd60e51b815260206004820152601a60248201527f76616c756520657874656e6465642070617374206c656e677468000000000000604482015290519081900360640190fd5b5091979650505050505050565b825160095460408051808201909152600a81526910d210d2d7d0d3d5539560b21b6020820152600092918214613c9a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50825181600101146040518060400160405280600c81526020016b4348434b5f4f46465345545360a01b81525090613d135760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600080805b83811015613ec1576000888281518110613d2f57fe5b60200260200101519050836bffffffffffffffffffffffff19168160601b6bffffffffffffffffffffffff1916116040518060400160405280600a81526020016921a421a5afa7a92222a960b11b81525090613dcc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506000613dd882612f9f565b60018101549091508b90613df4906001600160801b0316613294565b1015613eb3578060000154613e348d8b8b8781518110613e1057fe5b60200260200101518c8860010181518110613e2757fe5b6020026020010151613a65565b146040518060400160405280601181526020017021a421a5afa9aa20a5a2a92fa82927a7a360791b81525090613eab5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506001909301925b5060601b9250600101613d19565b5098975050505050505050565b60058190556040805182815290517f9d13d0ad532ca8e545a3b66828cb99a18c3bc98e2a50b4db1990a033fdba6f639181900360200190a150565b6040805160008082526020808301808552600360f81b948401948552835192946003938593919260418501929091028083838a5b83811015613f55578181015183820152602001613f3d565b50505050905001925050506040516020818303038152906040528051906020012091505090565b6040805160208082019590955280820193909352606080840192909252805180840390920182526080909201909152805191012090565b60011490565b1590565b80516000906001600160801b03164310801590613fe7575060208201516001600160801b03164311155b92915050565b6000612f0f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061432e565b60008061404f896101400151878b61012001518c60400151018803613f7c565b9050614073888861406b846140646001613294565b8801613303565b60008861329b565b9998505050505050505050565b6000806140aa8760200151886101400151614099613f09565b8a61016001518b6101200151614388565b905060006140c3826140bc6001613294565b8601613303565b90506140d387878360018961329b565b98975050505050505050565b6000806140fb88600001518961010001518a61016001516143ce565b9050600061412d8961018001518a6101a001518b6101c001516000801b8d6101e001516000801b8f6102000151614420565b905060006141408a60e001518484614483565b905061415b898961415384898b01613303565b60028b61329b565b9a9950505050505050505050565b6000613ac78383614184876101e00151886102000151613303565b60036141a68961018001518a61014001518b61012001518c6040015101613f7c565b61329b565b7f5761ea2104e5d52e617adb7f0bfc8970ffa1d06f57d28cb2bb3a034532c970356040518060e00160405280858152602001848152602001866101400151815260200186610160015181526020018661018001518152602001866101e00151815260200186610200015181525082866101200151876101000151886101c001518960e001518a6101a001516040518088600760200280838360005b8381101561425e578181015183820152602001614246565b5050505090500187815260200186815260200185600260200280838360005b8381101561429557818101518382015260200161427d565b50505067ffffffffffffffff9788169390910192835250509290931660208301521515604080830191909152519081900360600195509350505050a150505050565b60008060008060006142e7614e16565b6142f188886144cb565b9250925092508261430f575060009450859350849250614327915050565b60018261431b8361461a565b51919750955093505050505b9250925092565b600081848411156143805760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b505050900390565b60408051602080820197909752808201959095526060850193909352608084019190915260a0808401919091528151808403909101815260c09092019052805191012090565b815160209283015160408051808601969096526001600160801b0319608093841b81168783015291831b9091166050860152606080860193909352805180860390930183529301909252815191012090565b6040805160208082019990995296151560f81b8782015260c09590951b6001600160c01b031916604187015260498601939093526069850191909152608984015260a9808401919091528151808403909101815260c99092019052805191012090565b6040805160c09490941b6001600160c01b0319166020808601919091526028850193909352604880850192909252805180850390920182526068909301909252815191012090565b6000806144d6614e16565b845184106144f6576000846144eb6000614750565b925092509250614327565b600080859050600087828151811061450a57fe5b016020015160019092019160f81c90506000614524614e44565b60ff8316614558576145368a856147ce565b91965094509150848461454884614750565b9750975097505050505050614327565b60ff8316600114156145805761456e8a85614821565b91965094509050848461454883614982565b60ff8316600214156145a8576145968a856147ce565b919650945091508484614548846149e2565b600360ff8416108015906145bf5750600c60ff8416105b156145fa57600219830160606145d6828d88614a60565b9198509650905086866145e883614b1e565b99509950995050505050505050614327565b6000806146076000614750565b9199509750955050505050509250925092565b614622614e6b565b6060820151600c60ff90911610614674576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207479706520636f646560781b604482015290519081900360640190fd5b606082015160ff166146a15760405180602001604052806146988460000151614bce565b9052905061164d565b606082015160ff16600114156146e8576040518060200160405280614698846020015160000151856020015160400151866020015160600151876020015160200151614bf2565b606082015160ff166002141561470d575060408051602081019091528151815261164d565b600360ff16826060015160ff161015801561473157506060820151600c60ff909116105b1561474e5760405180602001604052806146988460400151614c9a565bfe5b614758614e16565b6040805160808082018352848252825190810183526000808252602082810182905282850182905260608301829052808401929092528351818152918201845291928301916147bd565b6147aa614e16565b8152602001906001900390816147a25790505b508152600060209091015292915050565b60008060008085519050848110806147e857506020858203105b156147fd575060009250839150829050614327565b600160208601614813888863ffffffff614de616565b935093509350509250925092565b60008061482c614e44565b6000849050600086828151811061483f57fe5b602001015160f81c60f81b60f81c90508180600101925050600087838151811061486557fe5b016020015160019384019360f89190911c915060009060ff841614156148ec57600061488f614e16565b6148998b876144cb565b9097509092509050816148dd575050604080516080810182526000808252602082018190529181018290526060810182905290975088965094506143279350505050565b6148e68161461a565b51925050505b60006148fe8a8663ffffffff614de616565b90506020850194508360ff166001141561494a576040805160808101825260ff909416845260208401919091526001908301819052606083019190915295509193509091506143279050565b6040805160808101825260ff949094168452602084019190915260009083018190526060830152506001989297509550909350505050565b61498a614e16565b6040805160808101825260008082526020808301869052835182815290810184529192830191906149d1565b6149be614e16565b8152602001906001900390816149b65790505b508152600160209091015292915050565b6149ea614e16565b604080516080808201835284825282519081018352600080825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191614a4f565b614a3c614e16565b815260200190600190039081614a345790505b508152600260209091015292915050565b60008060606000849050600060608860ff16604051908082528060200260200182016040528015614aab57816020015b614a98614e16565b815260200190600190039081614a905790505b50905060005b8960ff168160ff161015614b0857614ac989856144cb565b8451859060ff8616908110614ada57fe5b60209081029190910101529450925082614b005750600095508694509250614b15915050565b600101614ab1565b5060019550919350909150505b93509350939050565b614b26614e16565b614b308251614e02565b614b81576040805162461bcd60e51b815260206004820152601a60248201527f5475706c65206d75737420686176652076616c69642073697a65000000000000604482015290519081900360640190fd5b5060408051608080820183526000808352835191820184528082526020828101829052828501829052606080840192909252830191909152918101839052915160030160ff169082015290565b60408051602080820193909352815180820384018152908201909152805191012090565b60008315614c4c575060408051600160f81b6020808301919091526001600160f81b031960f888901b1660218301526022820185905260428083018590528351808403909101815260629092019092528051910120613ac7565b5060408051600160f81b6020808301919091526001600160f81b031960f888901b16602183015260228083018590528351808403909101815260429092019092528051910120949350505050565b6000600882511115614cea576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e8eae0d8ca40d8cadccee8d60631b604482015290519081900360640190fd5b60608251604051908082528060200260200182016040528015614d17578160200160208202803883390190505b50805190915060005b81811015614d7357614d30614e6b565b614d4c868381518110614d3f57fe5b602002602001015161461a565b90508060000151848381518110614d5f57fe5b602090810291909101015250600101614d20565b508351600360ff160182604051602001808360ff1660ff1660f81b8152600101828051906020019060200280838360005b83811015614dbc578181015183820152602001614da4565b50505050905001925050506040516020818303038152906040528051906020012092505050919050565b60008160200183511015614df957600080fd5b50016020015190565b6008101590565b61012c80614e7e83390190565b604051806080016040528060008152602001614e30614e44565b815260606020820152600060409091015290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040805160208101909152600081529056fe608060405234801561001057600080fd5b5060405161012c38038061012c8339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b031990921691909117905560c8806100646000396000f3fe608060408181526000805463c581831760e01b90935233608481815260a49384523660c48190526001600160a01b039095169463c5818317943494929060e4848480828437600081840152601f19601f8201169050808301925050509450505050506000604051808303818588803b158015607957600080fd5b505af1158015608c573d6000803e3d6000fd5b505050505000fea265627a7a72315820ef6af66735771e355ad8ed24b85e1205c0b4c59b346b246d679bebae727fcdc264736f6c634300050f00324e6f6e20696e7465726661636520636f6e74726163742063616e27742073656e64206d657373616765a265627a7a7231582042026658879c80359dca2b36891dd863e6eb9625649b6ac9ccd59792f9821c2f64736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 130, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b506040516104b03803806104b08339818101604052606081101561003357600080fd5b5080516020820151604090920151600080546001600160a01b039384166001600160a01b03199182161790915560018054948416948216949094179093556002805492909116919092161790556104218061008f6000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063582923c71461005157806362e3c0b1146100755780638689d9961461007d578063e13a218e14610085575b600080fd5b6100596100ee565b604080516001600160a01b039092168252519081900360200190f35b6100596100fd565b61005961010c565b6100ec600480360360e081101561009b57600080fd5b508035906001600160801b036020820135811691604081013582169167ffffffffffffffff606083013581169260808101359091169160a082013516906001600160a01b0360c0909101351661011b565b005b6001546001600160a01b031681565b6002546001600160a01b031681565b6000546001600160a01b031681565b60008054610131906001600160a01b0316610233565b600254600154604080516379d1120b60e01b8152600481018d90526001600160801b03808d166024830152808c16604483015267ffffffffffffffff808c1660648401528a166084830152881660a48201526001600160a01b0387811660c483015293841660e482015291831661010483015251929350908316916379d1120b916101248082019260009290919082900301818387803b1580156101d457600080fd5b505af11580156101e8573d6000803e3d6000fd5b5050604080516001600160a01b038516815290517f84c162f1396badc29f9c932c79d7495db699b615e2c0da163ae26bd5dbe71d7c9350908190036020019150a15050505050505050565b600060606040518060200161024790610350565b601f1982820381018352601f9091011660408181526001600160a01b038616602083810191909152815180840382018152828401909252835191926060019182918501908083835b602083106102ae5780518252601f19909201916020918201910161028f565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106102f65780518252601f1990920191602091820191016102d7565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529050806020018151808234f0935083610348573d6000803e3d6000fd5b505050919050565b60908061035d8339019056fe6080604052348015600f57600080fd5b506040516090380380609083398181016040526020811015602f57600080fd5b50516040805169363d3d373d3d3d363d7360b01b6020828101919091526001600160601b0319606085901b16602a8301526e5af43d82803e903d91602b57fd5bf360881b603e8301528251602d81840381018252604d9093019093528201f3fea265627a7a72315820deb87808dbb22cb55aac632065dc04f1a0ec47866e04e0d5a0c4b04335a3ced564736f6c634300050f0032000000000000000000000000d93da71b8f31180e39bd6b73224af1e7921cf839000000000000000000000000bb384caa8f0b81833cca2f75edf716cea98dd672000000000000000000000000677504adeb1703422456fc5ed98aa841ccde4e7c" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 135, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0xd7174ed628bc115c5be7e3d9e5056638e40967f1", + "data": "0xfdacd5760000000000000000000000000000000000000000000000000000000000000002" + } + ] + }, + { + "jsonrpc": "2.0", + "method": "evm_snapshot", + "id": 1586295443094 + }, + { + "jsonrpc": "2.0", + "id": 141, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "data": "0x608060405234801561001057600080fd5b50615007806100206000396000f3fe60806040526004361061014b5760003560e01c8063badb3f14116100b6578063d684f94b1161006f578063d684f94b14610dc8578063dbad0a3914610e94578063e0620d6414610f5f578063f75e48661461101d578063fcfd8d3f14611050578063ffa1ad74146113065761014b565b8063badb3f1414610c07578063bbc2cc0014610caa578063c581831714610cef578063cfa8070714610d6d578063d16c305d14610d82578063d489113a14610db35761014b565b806365f7f80d1161010857806365f7f80d146108aa5780636bc3cd22146108d157806379d1120b146109145780637cfaaf671461099a578063b7ff920e14610a15578063bac5963f14610a485761014b565b8063113ec9d8146101505780631a072771146101dd578063335540321461072857806357ca6d1b146108085780635dbaf68b146108465780636177fd1814610877575b600080fd5b34801561015c57600080fd5b506101db6004803603604081101561017357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561019d57600080fd5b8201836020820111156101af57600080fd5b803590602001918460208302840111600160201b831117156101d057600080fd5b509092509050611390565b005b3480156101e957600080fd5b506101db600480360361016081101561020157600080fd5b81359190810190604081016020820135600160201b81111561022257600080fd5b82018360208201111561023457600080fd5b803590602001918460208302840111600160201b8311171561025557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156102a457600080fd5b8201836020820111156102b657600080fd5b803590602001918460208302840111600160201b831117156102d757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561032657600080fd5b82018360208201111561033857600080fd5b803590602001918460208302840111600160201b8311171561035957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103a857600080fd5b8201836020820111156103ba57600080fd5b803590602001918460208302840111600160201b831117156103db57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561042a57600080fd5b82018360208201111561043c57600080fd5b803590602001918460208302840111600160201b8311171561045d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104ac57600080fd5b8201836020820111156104be57600080fd5b803590602001918460208302840111600160201b831117156104df57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561052e57600080fd5b82018360208201111561054057600080fd5b803590602001918460018302840111600160201b8311171561056157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156105b357600080fd5b8201836020820111156105c557600080fd5b803590602001918460208302840111600160201b831117156105e657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561063557600080fd5b82018360208201111561064757600080fd5b803590602001918460208302840111600160201b8311171561066857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156106b757600080fd5b8201836020820111156106c957600080fd5b803590602001918460208302840111600160201b831117156106ea57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611481945050505050565b34801561073457600080fd5b506101db6004803603608081101561074b57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561077a57600080fd5b82018360208201111561078c57600080fd5b803590602001918460208302840111600160201b831117156107ad57600080fd5b919390929091602081019035600160201b8111156107ca57600080fd5b8201836020820111156107dc57600080fd5b803590602001918460208302840111600160201b831117156107fd57600080fd5b5090925090506114e2565b34801561081457600080fd5b506108326004803603602081101561082b57600080fd5b503561163a565b604080519115158252519081900360200190f35b34801561085257600080fd5b5061085b611652565b604080516001600160a01b039092168252519081900360200190f35b34801561088357600080fd5b506108326004803603602081101561089a57600080fd5b50356001600160a01b0316611661565b3480156108b657600080fd5b506108bf61167e565b60408051918252519081900360200190f35b3480156108dd57600080fd5b506101db600480360360608110156108f457600080fd5b506001600160a01b03813581169160208101359091169060400135611684565b34801561092057600080fd5b506101db600480360361012081101561093857600080fd5b508035906001600160801b036020820135811691604081013582169167ffffffffffffffff606083013581169260808101359091169160a082013516906001600160a01b0360c082013581169160e081013582169161010090910135166117e0565b3480156109a657600080fd5b506101db600480360360208110156109bd57600080fd5b810190602081018135600160201b8111156109d757600080fd5b8201836020820111156109e957600080fd5b803590602001918460208302840111600160201b83111715610a0a57600080fd5b509092509050611822565b348015610a2157600080fd5b5061085b60048036036020811015610a3857600080fd5b50356001600160a01b0316611863565b348015610a5457600080fd5b506101db60048036036101a0811015610a6c57600080fd5b6040805180820182526001600160a01b0384358116946020810135909116938382013593606083013593918301929160c083019160808401906002908390839080828437600092019190915250506040805180820182529295949381810193925090600290839083908082843760009201919091525091949392602081019250359050600160201b811115610b0057600080fd5b820183602082011115610b1257600080fd5b803590602001918460208302840111600160201b83111715610b3357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610b8257600080fd5b820183602082011115610b9457600080fd5b803590602001918460208302840111600160201b83111715610bb557600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050823593505050602081013590604001356001600160801b031661187e565b348015610c1357600080fd5b506101db600480360360c0811015610c2a57600080fd5b6001600160a01b03823516916020810135916040820135916060810135916080820135919081019060c0810160a0820135600160201b811115610c6c57600080fd5b820183602082011115610c7e57600080fd5b803590602001918460208302840111600160201b83111715610c9f57600080fd5b509092509050611e24565b348015610cb657600080fd5b50610cbf611f9f565b60408051948552602085019390935267ffffffffffffffff91821684840152166060830152519081900360800190f35b6101db60048036036040811015610d0557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610d2f57600080fd5b820183602082011115610d4157600080fd5b803590602001918460018302840111600160201b83111715610d6257600080fd5b509092509050611fc0565b348015610d7957600080fd5b506101db61213a565b348015610d8e57600080fd5b50610d976121b9565b604080516001600160801b039092168252519081900360200190f35b348015610dbf57600080fd5b5061085b6121c8565b348015610dd457600080fd5b506101db6004803603610260811015610dec57600080fd5b610120820135906101408301359063ffffffff610160850135169067ffffffffffffffff6101808601358116916101a08701916101e0880135916102008901351515916102208a013516908901896102608101610240820135600160201b811115610e5657600080fd5b820183602082011115610e6857600080fd5b803590602001918460208302840111600160201b83111715610e8957600080fd5b5090925090506121d7565b348015610ea057600080fd5b506101db60048036036040811015610eb757600080fd5b810190602081018135600160201b811115610ed157600080fd5b820183602082011115610ee357600080fd5b803590602001918460208302840111600160201b83111715610f0457600080fd5b919390929091602081019035600160201b811115610f2157600080fd5b820183602082011115610f3357600080fd5b803590602001918460208302840111600160201b83111715610f5457600080fd5b509092509050612406565b6101db60048036036040811015610f7557600080fd5b810190602081018135600160201b811115610f8f57600080fd5b820183602082011115610fa157600080fd5b803590602001918460208302840111600160201b83111715610fc257600080fd5b919390929091602081019035600160201b811115610fdf57600080fd5b820183602082011115610ff157600080fd5b803590602001918460208302840111600160201b8311171561101257600080fd5b509092509050612517565b34801561102957600080fd5b506101db6004803603602081101561104057600080fd5b50356001600160a01b031661262a565b34801561105c57600080fd5b506101db600480360360a081101561107357600080fd5b810190602081018135600160201b81111561108d57600080fd5b82018360208201111561109f57600080fd5b803590602001918460208302840111600160201b831117156110c057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561110f57600080fd5b82018360208201111561112157600080fd5b803590602001918460208302840111600160201b8311171561114257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561119157600080fd5b8201836020820111156111a357600080fd5b803590602001918460208302840111600160201b831117156111c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561121357600080fd5b82018360208201111561122557600080fd5b803590602001918460208302840111600160201b8311171561124657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561129557600080fd5b8201836020820111156112a757600080fd5b803590602001918460208302840111600160201b831117156112c857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506126b3945050505050565b34801561131257600080fd5b5061131b612951565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561135557818101518382015260200161133d565b50505050905090810190601f1680156113825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60408051808201909152600e81526d0a48a86ac9e9888be988a9c8ea8960931b60208201528161143e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114035781810151838201526020016113eb565b50505050905090810190601f1680156114305780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5061147c8383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061296e92505050565b505050565b6114d56040518061016001604052808d81526020018c81526020018b81526020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815250612a0d565b5050505050505050505050565b60006114ed33612e6f565b9050828260008181106114fc57fe5b905060200201358585600081811061151057fe5b9050602002013514158015611567575061152861167e565b61156587878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b145b80156115ae5750806115ac87858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b145b604051806040016040528060148152602001732922a1a7ab2fa1a7a7232624a1aa2fa82927a7a360611b815250906116275760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5061163187612f16565b50505050505050565b60008181526004602052604090205460ff165b919050565b6006546001600160a01b031681565b6001600160a01b0316600090815260086020526040902054151590565b60055490565b336000908152600a6020908152604091829020548251808401909352600f83526e2922a9afa1a420a62fa9a2a72222a960891b9183019190915260ff1661170c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50336000908152600a60205260408120805460ff1916905561172d84612f9f565b6007546040519192506001600160a01b0386169160026001600160801b039283160490911680156108fc02916000818181858888f19350505050158015611778573d6000803e3d6000fd5b5060018101805460ff60801b1916905561179183613029565b604080513381526001600160a01b03808716602083015285168183015290517f468aa7d460319b17466ca163bca353a0c62fff0d7d0fa287f634ef305d946f299181900360600190a150505050565b6117ee89898989898661306a565b6117f8848361315e565b5050600b80546001600160a01b0319166001600160a01b0392909216919091179055505050505050565b61185f3383838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061296e92505050565b5050565b600d602052600090815260409020546001600160a01b031681565b60006118898c612f9f565b905060006118968c612f9f565b60018301549091508a906118b2906001600160801b0316613294565b106040518060400160405280600d81526020016c53544b315f444541444c494e4560981b815250906119255760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060018101548a9061193f906001600160801b0316613294565b106040518060400160405280600d81526020016c53544b325f444541444c494e4560981b815250906119b25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600182015460408051808201909152600c81526b14d512cc57d25397d0d2105360a21b602082015290600160801b900460ff1615611a325760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600181015460408051808201909152600c81526b14d512cc57d25397d0d2105360a21b602082015290600160801b900460ff1615611ab25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506020808a01518a5160408051808201909152600a8152692a2ca822afa7a92222a960b11b9381019390935211611b2a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b508154611b52611b4c8d8d898e600060200201518e60005b602002015161329b565b89612eff565b146040518060400160405280600c81526020016b20a9a9a2a92a2fa82927a7a360a11b81525090611bc45760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b508054611bf5611bef8d8d611be2896001600160801b038a16613303565b60208f01518e6001611b42565b88612eff565b146040518060400160405280600a81526020016921a420a62fa82927a7a360b11b81525090611c655760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060018260010160106101000a81548160ff02191690831515021790555060018160010160106101000a81548160ff0219169083151502179055506000600660009054906101000a90046001600160a01b03166001600160a01b031663865da1c28f8f87898f600160028110611cd757fe5b60200201516040518663ffffffff1660e01b815260040180866001600160a01b03166001600160a01b03168152602001856001600160a01b03166001600160a01b03168152602001846001600160801b0316815260200183815260200182815260200195505050505050602060405180830381600087803b158015611d5b57600080fd5b505af1158015611d6f573d6000803e3d6000fd5b505050506040513d6020811015611d8557600080fd5b50516001600160a01b0381166000908152600a60205260409020805460ff191660019081179091559091507f6c69257ddf620994c6fb9e5304db0e5563db3765bee033ddd61b6a1caa7d043f908f908f908d9060209081029190910151604080516001600160a01b0395861681529385169284019290925282820152918416606082015290519081900360800190a15050505050505050505050505050565b6000611e2f33612e6f565b90506000611e40828989898961329b565b90506000611e8182868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b9050611e8c8161163a565b604051806040016040528060138152602001722922a1a7ab2fa222a0a22624a722afa622a0a360691b81525090611f045760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50611f0e89613294565b431015604051806040016040528060138152602001725245434f565f444541444c494e455f54494d4560681b81525090611f895760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50611f938a612f16565b50505050505050505050565b60015460025460035467ffffffffffffffff80821691600160401b90041684565b336000908152600c60205260409020546001600160a01b0316806120155760405162461bcd60e51b8152600401808060200182810382526029815260200180614faa6029913960400191505060405180910390fd5b60008054604080516396588a2760e01b81526001600160a01b0385811660048301528881166024830152915191909216926396588a279234926044808301939282900301818588803b15801561206a57600080fd5b505af115801561207e573d6000803e3d6000fd5b50506000546040516384cb799760e01b81526001600160a01b03868116600483019081528a821660248401523460448401819052608060648501908152608485018b90529290941696506384cb799795508794508a93928a928a929160a401848480828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b15801561211c57600080fd5b505af1158015612130573d6000803e3d6000fd5b5050505050505050565b600b5460408051808201909152600a81526927a7262cafa7aba722a960b11b6020820152906001600160a01b031633146121b55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5033ff5b6007546001600160801b031690565b6000546001600160a01b031681565b6000806123256040518061022001604052808f6000600981106121f657fe5b602002013581526020018f60016009811061220d57fe5b602002013581526020018e81526020018f60026009811061222a57fe5b602002013581526020018d81526020018f60036009811061224757fe5b602002013581526020018c63ffffffff1681526020018b67ffffffffffffffff1681526020018a600280602002604051908101604052809291908260026020028082843760009201919091525050508152602081018a90526040018f6004602002013581526020018f6005600981106122bc57fe5b602002013581526020018f6006600981106122d357fe5b6020020135815260200188151581526020018767ffffffffffffffff1681526020018f60076009811061230257fe5b602002013581526020018f60086009811061231957fe5b6020020135905261332f565b91509150600061233433612e6f565b90508261237482878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b146040518060400160405280601181526020017026a0a5a2afa9aa20a5a2a92fa82927a7a360791b815250906123eb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506123f6338361385e565b5050505050505050505050505050565b600061241133612e6f565b9050600061245282878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b9050600061249382868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b905061249e8161163a565b6040518060400160405280600981526020016826a7ab22afa622a0a360b91b8152509061250c5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50611631338361385e565b600061255d61252461167e565b868680806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b9050600061259e82858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250612eff92505050565b90506125a98161163a565b6040518060400160405280600a815260200169282620a1a2afa622a0a360b11b815250906126185760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50612622826138b7565b505050505050565b60003060405161263990614e09565b6001600160a01b03909116815260405190819003602001906000f080158015612666573d6000803e3d6000fd5b506001600160a01b039081166000818152600c602090815260408083208054959097166001600160a01b03199586168117909755958252600d905293909320805490911690921790915550565b84518351811480156126c55750808251145b61270f576040805162461bcd60e51b81526020600482015260166024820152750d2dce0eae840d8cadccee8d040dad2e6e8dac2e8c6d60531b604482015290519081900360640190fd5b600080805b8381101561294657600089828151811061272a57fe5b60200260200101519050600088838151811061274257fe5b602002602001015111801561276a5750600086838151811061276057fe5b6020026020010151115b6040518060400160405280600e81526020016d28292aa722afa82927a7a32622a760911b815250906127dd5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060008883815181106127ec57fe5b602002602001015185019050600087848151811061280657fe5b60200260200101518501905088858151811061281e57fe5b60200260200101518b878151811061283257fe5b602002602001015114158015612859575061284b61167e565b612857848b8885613a65565b145b6040518060400160405280600e81526020016d141495539157d0d3d391931250d560921b815250906128cc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060006128db848d8986613a65565b90506128e68161163a565b1561293757600081815260046020908152604091829020805460ff19169055815183815291517f3d3e2ada9638548d1bb115fd766ef675213d953efe8d433bbd8d6718f44909509281900390910190a15b50909450925050600101612714565b505050505050505050565b604051806040016040528060018152602001603160f81b81525081565b600061297933612e6f565b905061298361167e565b61298d8284612eff565b146040518060400160405280601081526020016f2922a1a7ab2fa820aa242fa82927a7a360811b81525090612a035760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5061147c83612f16565b60208101515160c08201515160a0830151518114612a2a57600080fd5b8083608001515114612a3b57600080fd5b8183604001515114612a4c57600080fd5b80820383606001515114612a5f57600080fd5b6000808080612a6c61167e565b875190915060005b87811015612b7057600089602001518281518110612a8e57fe5b6020026020010151905060006003821415612b1d5760008b60c001518981518110612ab557fe5b60200260200101519050612aee612ad18d60e001518984613acf565b8d608001518b81518110612ae157fe5b6020026020010151613303565b915080870196508b60a001518981518110612b0557fe5b60200260200101519450888060010199505050612b40565b8a606001518781518110612b2d57fe5b6020026020010151905086806001019750505b612b64858c604001518581518110612b5457fe5b602002602001015183858861329b565b94505050600101612a74565b508760e00151518314612bca576040805162461bcd60e51b815260206004820152601860248201527f4469646e2774207265616420616c6c206d657373616765730000000000000000604482015290519081900360640190fd5b87604001516001880381518110612bdd57fe5b6020026020010151612bee43613294565b101560405180604001604052806009815260200168434f4e465f54494d4560b81b81525090612c5e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506000612c97838a6040015160018b0381518110612c7857fe5b60200260200101518b61010001518c61012001518d6101400151613c23565b9050600081116040518060400160405280600f81526020016e21a7a7232fa420a9afa9aa20a5a2a960891b81525090612d115760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50612d1b83613ece565b6000805460e08b015160405163e4eb8c6360e01b81526020600482018181528351602484015283516001600160a01b039095169563e4eb8c639591938493604490910192908601918190849084905b83811015612d82578181015183820152602001612d6a565b50505050905090810190601f168015612daf5780820380516001836020036101000a031916815260200191505b5092505050600060405180830381600087803b158015612dce57600080fd5b505af1158015612de2573d6000803e3d6000fd5b50505050600086111561294657608089015160408051602080825283518183015283517fded5fa103431438087188a5f8c6a4c3ea90996bbd63be7b1b3fa0a425b37fdd59493839290830191818601910280838360005b83811015612e51578181015183820152602001612e39565b505050509050019250505060405180910390a1505050505050505050565b6001600160a01b0381166000908152600860209081526040808320548151808301909252600a82526924a72b2fa9aa20a5a2a960b11b9282019290925281612ef85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5092915050565b6000612f0f838360008551613a65565b9392505050565b612f1f81613029565b6007546040516001600160a01b038316916001600160801b031680156108fc02916000818181858888f19350505050158015612f5f573d6000803e3d6000fd5b50604080516001600160a01b038316815290517f953ab9eece73c907353307064109cf873462177a0e358e463fd89f5b206daa6c9181900360200190a150565b6001600160a01b038116600090815260086020908152604080832080548251808401909352600a83526924a72b2fa9aa20a5a2a960b11b9383019390935291612ef85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b6001600160a01b03166000908152600860205260408120908155600101805470ffffffffffffffffffffffffffffffffff1916905560098054600019019055565b600080546001600160a01b0319166001600160a01b03831617815561309887613091613f09565b6000613f7c565b905060006130a9818080808661329b565b6005819055600081815260046020908152604091829020805460ff191660019081179091556001600160801b03808c1690915589166002556003805467ffffffffffffffff898116600160401b026fffffffffffffffff000000000000000019918c1667ffffffffffffffff19909316929092171617905581518b815291519293507f4ac0014773275a3dfb58c58539631006301de41998cce7c4f8698d297c88bb2d92918290030190a15050505050505050565b60065460408051808201909152600a815269494e49545f545749434560b01b6020820152906001600160a01b0316156131d85760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060408051808201909152600c81526b494e49545f4e4f4e5a45524f60a01b60208201526001600160a01b0382166132515760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600680546001600160a01b0319166001600160a01b0392909216919091179055600780546001600160801b0319166001600160801b0392909216919091179055565b6103e80290565b6040805160208082018490528183018790526060820186905260808083018690528351808403909101815260a08301845280519082012060c0830189905260e08084019190915283518084039091018152610100909201909252805191012095945050505050565b604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b600080600061334b846000015185602001518660400151613f7c565b90506000613372856060015186608001518760a001518860c0015163ffffffff168661329b565b905061337d8161163a565b6040518060400160405280600981526020016826a0a5a2afa622a0a360b91b815250906133eb5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5084516133f790613fb3565b15801561340c5750845161340a90613fb9565b155b6040518060400160405280600881526020016726a0a5a2afa92aa760c11b815250906134795760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5060035460e086015160408051808201909152600981526804d414b455f535445560bc1b60208201529167ffffffffffffffff908116911611156134fe5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506003546101008601518051600160401b90920467ffffffffffffffff169091016001600160801b031690600160200201516001600160801b0316111561354457600080fd5b613552856101000151613fbd565b604051806040016040528060098152602001684d414b455f54494d4560b81b815250906135c05760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5061012085015115806135d55750846101a001515b6040518060400160405280600d81526020016c4d414b455f4d4553534147455360981b815250906136475760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506000805460408051630220168160e01b8152306004820152815184936001600160a01b03169263022016819260248082019391829003018186803b15801561368f57600080fd5b505afa1580156136a3573d6000803e3d6000fd5b505050506040513d60408110156136b957600080fd5b508051602090910151604089015191935091506136dd90829063ffffffff613fed16565b87610120015111156040518060400160405280601081526020016f135052d157d35154d4d051d157d0d39560821b8152509061375a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506001546002546101c08901516000919067ffffffffffffffff168161377c57fe5b04905060008261378b43613294565b01905089608001518110156137a1575060808901515b810160006137b48b888489898d8a61402f565b905060006137c58c89858c89614080565b905060006137d78d8a868d8a8a6140df565b905060006137e68e8b87614169565b6000858152600460205260408082208054600160ff19918216811790925587845282842080548216831790558684528284208054821683179055848452828420805482169092179091558d8352912080549091169055905061384a8e8b8b8b6141ab565b989b50979950505050505050505050915091565b6001600160a01b0382166000818152600860209081526040918290208490558151928352820183905280517fbe690ac5fe353c094bcc6f187eeb841c0ca61b6edf32c142eadad655b7d173f49281900390910190a15050565b60078054604080518082019091529182526614d512d7d0535560ca1b60208301526001600160801b0316341461392e5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b5033600090815260086020908152604091829020548251808401909352600c83526b105314911657d4d51052d15160a21b91830191909152156139b25760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50604080516060810182528281526001600160801b03438116602080840191825260008486018181523380835260088452918790209551865592516001958601805494511515600160801b0260ff60801b19929096166001600160801b031990951694909417169390931790915560098054909301909255825190815290810183905281517fcbafbb223ed21c82af9e2ad20cdfdf55d3263d06f9a65b3f70da613f32d81f88929181900390910190a150565b600084835b83811015613ac35781868281518110613a7f57fe5b602002602001015160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012091508080600101915050613a6a565b5090505b949350505050565b825160009081908190819086860190811115613b23576040805162461bcd60e51b815260206004820152600e60248201526d0d2dcecc2d8d2c840d8cadccee8d60931b604482015290519081900360640190fd5b865b81811015613bc057613b3789826142d7565b919650909350905084613b8a576040805162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7574707574206d65737361676560501b604482015290519081900360640190fd5b83836040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209350613b25565b8688018114613c16576040805162461bcd60e51b815260206004820152601a60248201527f76616c756520657874656e6465642070617374206c656e677468000000000000604482015290519081900360640190fd5b5091979650505050505050565b825160095460408051808201909152600a81526910d210d2d7d0d3d5539560b21b6020820152600092918214613c9a5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50825181600101146040518060400160405280600c81526020016b4348434b5f4f46465345545360a01b81525090613d135760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b50600080805b83811015613ec1576000888281518110613d2f57fe5b60200260200101519050836bffffffffffffffffffffffff19168160601b6bffffffffffffffffffffffff1916116040518060400160405280600a81526020016921a421a5afa7a92222a960b11b81525090613dcc5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506000613dd882612f9f565b60018101549091508b90613df4906001600160801b0316613294565b1015613eb3578060000154613e348d8b8b8781518110613e1057fe5b60200260200101518c8860010181518110613e2757fe5b6020026020010151613a65565b146040518060400160405280601181526020017021a421a5afa9aa20a5a2a92fa82927a7a360791b81525090613eab5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b506001909301925b5060601b9250600101613d19565b5098975050505050505050565b60058190556040805182815290517f9d13d0ad532ca8e545a3b66828cb99a18c3bc98e2a50b4db1990a033fdba6f639181900360200190a150565b6040805160008082526020808301808552600360f81b948401948552835192946003938593919260418501929091028083838a5b83811015613f55578181015183820152602001613f3d565b50505050905001925050506040516020818303038152906040528051906020012091505090565b6040805160208082019590955280820193909352606080840192909252805180840390920182526080909201909152805191012090565b60011490565b1590565b80516000906001600160801b03164310801590613fe7575060208201516001600160801b03164311155b92915050565b6000612f0f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061432e565b60008061404f896101400151878b61012001518c60400151018803613f7c565b9050614073888861406b846140646001613294565b8801613303565b60008861329b565b9998505050505050505050565b6000806140aa8760200151886101400151614099613f09565b8a61016001518b6101200151614388565b905060006140c3826140bc6001613294565b8601613303565b90506140d387878360018961329b565b98975050505050505050565b6000806140fb88600001518961010001518a61016001516143ce565b9050600061412d8961018001518a6101a001518b6101c001516000801b8d6101e001516000801b8f6102000151614420565b905060006141408a60e001518484614483565b905061415b898961415384898b01613303565b60028b61329b565b9a9950505050505050505050565b6000613ac78383614184876101e00151886102000151613303565b60036141a68961018001518a61014001518b61012001518c6040015101613f7c565b61329b565b7f5761ea2104e5d52e617adb7f0bfc8970ffa1d06f57d28cb2bb3a034532c970356040518060e00160405280858152602001848152602001866101400151815260200186610160015181526020018661018001518152602001866101e00151815260200186610200015181525082866101200151876101000151886101c001518960e001518a6101a001516040518088600760200280838360005b8381101561425e578181015183820152602001614246565b5050505090500187815260200186815260200185600260200280838360005b8381101561429557818101518382015260200161427d565b50505067ffffffffffffffff9788169390910192835250509290931660208301521515604080830191909152519081900360600195509350505050a150505050565b60008060008060006142e7614e16565b6142f188886144cb565b9250925092508261430f575060009450859350849250614327915050565b60018261431b8361461a565b51919750955093505050505b9250925092565b600081848411156143805760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156114035781810151838201526020016113eb565b505050900390565b60408051602080820197909752808201959095526060850193909352608084019190915260a0808401919091528151808403909101815260c09092019052805191012090565b815160209283015160408051808601969096526001600160801b0319608093841b81168783015291831b9091166050860152606080860193909352805180860390930183529301909252815191012090565b6040805160208082019990995296151560f81b8782015260c09590951b6001600160c01b031916604187015260498601939093526069850191909152608984015260a9808401919091528151808403909101815260c99092019052805191012090565b6040805160c09490941b6001600160c01b0319166020808601919091526028850193909352604880850192909252805180850390920182526068909301909252815191012090565b6000806144d6614e16565b845184106144f6576000846144eb6000614750565b925092509250614327565b600080859050600087828151811061450a57fe5b016020015160019092019160f81c90506000614524614e44565b60ff8316614558576145368a856147ce565b91965094509150848461454884614750565b9750975097505050505050614327565b60ff8316600114156145805761456e8a85614821565b91965094509050848461454883614982565b60ff8316600214156145a8576145968a856147ce565b919650945091508484614548846149e2565b600360ff8416108015906145bf5750600c60ff8416105b156145fa57600219830160606145d6828d88614a60565b9198509650905086866145e883614b1e565b99509950995050505050505050614327565b6000806146076000614750565b9199509750955050505050509250925092565b614622614e6b565b6060820151600c60ff90911610614674576040805162461bcd60e51b8152602060048201526011602482015270496e76616c6964207479706520636f646560781b604482015290519081900360640190fd5b606082015160ff166146a15760405180602001604052806146988460000151614bce565b9052905061164d565b606082015160ff16600114156146e8576040518060200160405280614698846020015160000151856020015160400151866020015160600151876020015160200151614bf2565b606082015160ff166002141561470d575060408051602081019091528151815261164d565b600360ff16826060015160ff161015801561473157506060820151600c60ff909116105b1561474e5760405180602001604052806146988460400151614c9a565bfe5b614758614e16565b6040805160808082018352848252825190810183526000808252602082810182905282850182905260608301829052808401929092528351818152918201845291928301916147bd565b6147aa614e16565b8152602001906001900390816147a25790505b508152600060209091015292915050565b60008060008085519050848110806147e857506020858203105b156147fd575060009250839150829050614327565b600160208601614813888863ffffffff614de616565b935093509350509250925092565b60008061482c614e44565b6000849050600086828151811061483f57fe5b602001015160f81c60f81b60f81c90508180600101925050600087838151811061486557fe5b016020015160019384019360f89190911c915060009060ff841614156148ec57600061488f614e16565b6148998b876144cb565b9097509092509050816148dd575050604080516080810182526000808252602082018190529181018290526060810182905290975088965094506143279350505050565b6148e68161461a565b51925050505b60006148fe8a8663ffffffff614de616565b90506020850194508360ff166001141561494a576040805160808101825260ff909416845260208401919091526001908301819052606083019190915295509193509091506143279050565b6040805160808101825260ff949094168452602084019190915260009083018190526060830152506001989297509550909350505050565b61498a614e16565b6040805160808101825260008082526020808301869052835182815290810184529192830191906149d1565b6149be614e16565b8152602001906001900390816149b65790505b508152600160209091015292915050565b6149ea614e16565b604080516080808201835284825282519081018352600080825260208281018290528285018290526060830182905280840192909252835181815291820184529192830191614a4f565b614a3c614e16565b815260200190600190039081614a345790505b508152600260209091015292915050565b60008060606000849050600060608860ff16604051908082528060200260200182016040528015614aab57816020015b614a98614e16565b815260200190600190039081614a905790505b50905060005b8960ff168160ff161015614b0857614ac989856144cb565b8451859060ff8616908110614ada57fe5b60209081029190910101529450925082614b005750600095508694509250614b15915050565b600101614ab1565b5060019550919350909150505b93509350939050565b614b26614e16565b614b308251614e02565b614b81576040805162461bcd60e51b815260206004820152601a60248201527f5475706c65206d75737420686176652076616c69642073697a65000000000000604482015290519081900360640190fd5b5060408051608080820183526000808352835191820184528082526020828101829052828501829052606080840192909252830191909152918101839052915160030160ff169082015290565b60408051602080820193909352815180820384018152908201909152805191012090565b60008315614c4c575060408051600160f81b6020808301919091526001600160f81b031960f888901b1660218301526022820185905260428083018590528351808403909101815260629092019092528051910120613ac7565b5060408051600160f81b6020808301919091526001600160f81b031960f888901b16602183015260228083018590528351808403909101815260429092019092528051910120949350505050565b6000600882511115614cea576040805162461bcd60e51b8152602060048201526014602482015273092dcecc2d8d2c840e8eae0d8ca40d8cadccee8d60631b604482015290519081900360640190fd5b60608251604051908082528060200260200182016040528015614d17578160200160208202803883390190505b50805190915060005b81811015614d7357614d30614e6b565b614d4c868381518110614d3f57fe5b602002602001015161461a565b90508060000151848381518110614d5f57fe5b602090810291909101015250600101614d20565b508351600360ff160182604051602001808360ff1660ff1660f81b8152600101828051906020019060200280838360005b83811015614dbc578181015183820152602001614da4565b50505050905001925050506040516020818303038152906040528051906020012092505050919050565b60008160200183511015614df957600080fd5b50016020015190565b6008101590565b61012c80614e7e83390190565b604051806080016040528060008152602001614e30614e44565b815260606020820152600060409091015290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b6040805160208101909152600081529056fe608060405234801561001057600080fd5b5060405161012c38038061012c8339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b031990921691909117905560c8806100646000396000f3fe608060408181526000805463c581831760e01b90935233608481815260a49384523660c48190526001600160a01b039095169463c5818317943494929060e4848480828437600081840152601f19601f8201169050808301925050509450505050506000604051808303818588803b158015607957600080fd5b505af1158015608c573d6000803e3d6000fd5b505050505000fea265627a7a72315820ef6af66735771e355ad8ed24b85e1205c0b4c59b346b246d679bebae727fcdc264736f6c634300050f00324e6f6e20696e7465726661636520636f6e74726163742063616e27742073656e64206d657373616765a265627a7a7231582042026658879c80359dca2b36891dd863e6eb9625649b6ac9ccd59792f9821c2f64736f6c634300050f0032" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 145, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0x79d1120b990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000f4240000000000000000000000000000000000000000000000000000000000000c3500000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000360e034a59596ceeb5cf3909c209f0b4255d883000000000000000000000000677504adeb1703422456fc5ed98aa841ccde4e7c000000000000000000000000bb384caa8f0b81833cca2f75edf716cea98dd672" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 1, + "method": "web3_clientVersion", + "params": [] + }, + { + "jsonrpc": "2.0", + "id": 152, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b340000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28769c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 156, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b990000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28769c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e287000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c351000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000001900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 160, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b990000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28769c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 163, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b990000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28769c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002710000000000000000000000000000000000000000000000000000000000000271a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 167, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b990000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28769c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 171, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b990000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e2870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28769c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013000000000000000000000000000000000000000000000000000000000000001d000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 174, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "value": "0xa", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xe0620d640000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 181, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0xd684f94b990000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000069c322e3248a5dfc29d73c5b0553b0185a35cd5bb6386747517ef7e53b15e28785000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015000000000000000000000000000000000000000000000000000000000000001f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 186, + "method": "eth_call", + "params": [ + { + "from": "0x0360e034a59596ceeb5cf3909c209f0b4255d883", + "gas": "0x6691b7", + "gasPrice": "0x4a817c800", + "to": "0x6912c0800f756b2d0213854b149e72eb31c02fbe", + "data": "0x57ca6d1b0c6d9504d60c2e1c3ec9fb6fbb8a0eeecb259ab931d77e257e3bc093675ef5c9" + }, + "latest" + ] + } +] diff --git a/tests/web3/blockhashes.expected.json b/tests/web3/blockhashes.expected.json new file mode 100644 index 0000000000..ee080b4cc8 --- /dev/null +++ b/tests/web3/blockhashes.expected.json @@ -0,0 +1,115 @@ +[ + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": "0x0" + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": "0x0" + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": { + "number": "0x0", + "hash": "0x866d21eac1da589c9d7ac643fa1570492cd69b2e5a6992311621e950997b1874", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot": "0xc9c525a88aaa65ef3c2c291589dce6825f54419d06c1194ffab3583a3a21ce74", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x0", + "gasUsed": "0x0", + "timestamp": "0x0", + "transactions": [], + "uncles": [] + } + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": "0x866d21eac1da589c9d7ac643fa1570492cd69b2e5a6992311621e950997b1874" + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": { + "number": "0x1", + "hash": "0x607cfb0c53b67795a74468f23e40262ca3592a3c475b210e0fcbeb0dbd4e4046", + "parentHash": "0x866d21eac1da589c9d7ac643fa1570492cd69b2e5a6992311621e950997b1874", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot": "0xa60411595542aa500d5d267c0ebef14e2cc75a1324def46f1d162a2cf39a39f3", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x0", + "gasUsed": "0x0", + "timestamp": "0x0", + "transactions": [], + "uncles": [] + } + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": "0x607cfb0c53b67795a74468f23e40262ca3592a3c475b210e0fcbeb0dbd4e4046" + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": { + "number": "0x2", + "hash": "0xa5ea456498c341fb8f9f9ada77845258c6de4cb7afe695053c78974fc5fd2140", + "parentHash": "0x607cfb0c53b67795a74468f23e40262ca3592a3c475b210e0fcbeb0dbd4e4046", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot": "0xd6ed56ef2e58feded193254a19f7408d6876a65503a45f46d2378796f3614f23", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x0", + "gasUsed": "0x0", + "timestamp": "0x0", + "transactions": [], + "uncles": [] + } + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": "0xa5ea456498c341fb8f9f9ada77845258c6de4cb7afe695053c78974fc5fd2140" + } +] diff --git a/tests/web3/blockhashes.in.json b/tests/web3/blockhashes.in.json new file mode 100644 index 0000000000..34ddd6fef6 --- /dev/null +++ b/tests/web3/blockhashes.in.json @@ -0,0 +1,93 @@ +[ + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0x5fffe36d0218b8b8d45d4e70788096a5e0c289cf89c907f97d1cdecdccaa8b6b", + "code": "0x6000354060005260206000f3" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_genesisBlock", + "params": [ + "0x0" + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "evm_mine", + "params": [] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "evm_mine", + "params": [] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getBlockByNumber", + "params": [ + "0x0", + false + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "eth_call", + "params": [ + { + "to": "0xee70809b448816b3d2d40c1db8b44aacf50bad3a", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getBlockByNumber", + "params": [ + "0x1", + false + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "eth_call", + "params": [ + { + "to": "0xee70809b448816b3d2d40c1db8b44aacf50bad3a", + "data": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "eth_getBlockByNumber", + "params": [ + "0x2", + false + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "eth_call", + "params": [ + { + "to": "0xee70809b448816b3d2d40c1db8b44aacf50bad3a", + "data": "0x0000000000000000000000000000000000000000000000000000000000000002" + } + ] + } +] diff --git a/tests/web3/ethCall_lowBalance.expected.json b/tests/web3/ethCall_lowBalance.expected.json index 43bdbaf05a..3702de00b2 100644 --- a/tests/web3/ethCall_lowBalance.expected.json +++ b/tests/web3/ethCall_lowBalance.expected.json @@ -18,7 +18,7 @@ "jsonrpc": "2.0", "id": 4, "error": { - "message": "VM Exception while processing transaction: revert", + "message": "VM Exception while processing transaction: revert Crowdsale: beneficiary is the zero address", "code": -32000, "data": { "0xda98dca8c2080bb61048a6dfa4722c86ea5d738e9f4609436f0a56623f2ed3df": { diff --git a/tests/web3/eth_getBlockByNumber1Tx.expected.json b/tests/web3/eth_getBlockByNumber1Tx.expected.json index 2e02d3f757..c9602e965e 100644 --- a/tests/web3/eth_getBlockByNumber1Tx.expected.json +++ b/tests/web3/eth_getBlockByNumber1Tx.expected.json @@ -17,20 +17,20 @@ { "jsonrpc": "2.0", "id": 3, - "result": "0x0e0e58533e93a19bc4a0b0656e186d9ba1062ce2661b8bc3d120d3a2a54a6783" + "result": "0xb194c622af15e1cf8ec01b9325223fadf102f94df6e6a9c4f8810960fb0c797d" }, { "jsonrpc": "2.0", "id": 4, "result": { "number": "0x1", - "hash": "0xccffb475947ec2a4f855a1e56387ddebf09f0d97077c42bd1daf24596341f174", + "hash": "0x4db33fa9f14cd5ac69c32e2231f3f0cc2e6c66a05e9e23efb5a7fa8fb0ca0e5a", "parentHash": "0x8dbc1f5985436ad7a31d0205238c8bdab6c4537913fe301f0d5732c1c7d1fada", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0x314104ec9dfee7f59ea3acce683e78c8d7aacb062337f8d5abc00fb0e4af124e", + "transactionsRoot": "0xcdb43a24db45ab4a20b4734e53f9366c335384a3a90bddda9eac7438932d7fd4", "stateRoot": "0xce0fffe3c38ad0f0759bc87cd579b426105353fd9b1e664cb0ecb64a3aa5b5d6", "receiptsRoot": "0x65c4d1b533902562730f0d110bcce51643ce4725ca03d85c33d5812c0ed308bf", "miner": "0x0000000000000000000000000000000000000000", @@ -42,7 +42,7 @@ "gasUsed": "0xcf08", "timestamp": "0x5dcc9900", "transactions": [ - "0x0e0e58533e93a19bc4a0b0656e186d9ba1062ce2661b8bc3d120d3a2a54a6783" + "0xb194c622af15e1cf8ec01b9325223fadf102f94df6e6a9c4f8810960fb0c797d" ], "uncles": [] } diff --git a/tests/web3/eth_getTransactionReceipt.expected.json b/tests/web3/eth_getTransactionReceipt.expected.json index b46668b076..a0a027c1af 100644 --- a/tests/web3/eth_getTransactionReceipt.expected.json +++ b/tests/web3/eth_getTransactionReceipt.expected.json @@ -14,11 +14,6 @@ "id": 1, "result": true }, - { - "jsonrpc": "2.0", - "id": 1, - "result": "1575490155" - }, { "jsonrpc": "2.0", "id": 2, @@ -30,7 +25,7 @@ "result": { "transactionHash": "0x48b3bce222588aff4329c7c7aebaa39ffb66045254c1ca16b9b1a5482463682b", "transactionIndex": "0x0", - "blockHash": "0x90720f724fda87554c42728507a107e829a016eff2989826ee4cced5001ade00", + "blockHash": "0x1c666528813a99142d352d495f002bb2d5b9af4917a404a32a7986cffff6d12e", "blockNumber": "0x1", "from": "0x79a59cf0083efdf696befda81655104787f938d0", "to": null, diff --git a/tests/web3/eth_getTransactionReceipt.in.json b/tests/web3/eth_getTransactionReceipt.in.json index a0a181177a..5b9bd99d01 100644 --- a/tests/web3/eth_getTransactionReceipt.in.json +++ b/tests/web3/eth_getTransactionReceipt.in.json @@ -24,14 +24,6 @@ "method": "firefly_genesisBlock", "params": ["0x5de81233"] }, - { - "jsonrpc": "2.0", - "id": 1, - "method": "evm_increaseTime", - "params": [ - 56 - ] - }, { "jsonrpc": "2.0", "id": 2, diff --git a/tests/web3/eth_getTxByHash.expected.json b/tests/web3/eth_getTxByHash.expected.json index b4452a5a28..5b533f607c 100644 --- a/tests/web3/eth_getTxByHash.expected.json +++ b/tests/web3/eth_getTxByHash.expected.json @@ -19,11 +19,6 @@ "id": 4, "result": true }, - { - "jsonrpc": "2.0", - "id": 5, - "result": "1580240972" - }, { "jsonrpc": "2.0", "id": 6, @@ -35,7 +30,7 @@ "result": { "hash": "0x39b09826768d9188b075a94846992209f83da9e1b715a3749038f16d567fdc99", "nonce": "0x0", - "blockHash": "0xc91d016633139837223a8d4f951d32e469fdb002324f1a1bd02f6a81b4595bad", + "blockHash": "0x33995c8354d84aff4f2795ade8b053b0a3580acb4693897ce08dfef907db2ff1", "blockNumber": "0x1", "transactionIndex": "0x0", "from": "0x079b5ed13cdda205e58a045248d28dec2cdb22c8", diff --git a/tests/web3/eth_getTxByHash.in.json b/tests/web3/eth_getTxByHash.in.json index 14df8c36a3..1fe81de688 100644 --- a/tests/web3/eth_getTxByHash.in.json +++ b/tests/web3/eth_getTxByHash.in.json @@ -35,14 +35,6 @@ "method": "firefly_genesisBlock", "params": ["0x5e308d5b"] }, - { - "jsonrpc": "2.0", - "id": 5, - "method": "evm_increaseTime", - "params": [ - 753 - ] - }, { "jsonrpc": "2.0", "id": 6, diff --git a/tests/web3/evm_increaseTime_fail.expected.json b/tests/web3/evm_increaseTime_fail.expected.json new file mode 100644 index 0000000000..89684ad416 --- /dev/null +++ b/tests/web3/evm_increaseTime_fail.expected.json @@ -0,0 +1,10 @@ +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +{ + "jsonrpc": "2.0", + "id": 2, + "result": "-1588697621" +} diff --git a/tests/web3/evm_increaseTime_fail.in.json b/tests/web3/evm_increaseTime_fail.in.json new file mode 100644 index 0000000000..3803e4d59c --- /dev/null +++ b/tests/web3/evm_increaseTime_fail.in.json @@ -0,0 +1,14 @@ +{ + "jsonrpc": "2.0", + "method": "firefly_genesisBlock", + "params": ["0x0"], + "id": 1 +} +{ + "jsonrpc": "2.0", + "method": "evm_increaseTime", + "params": [ + 1 + ], + "id": 2 +} diff --git a/tests/web3/firefly_setGasPrice.expected.json b/tests/web3/firefly_setGasPrice.expected.json new file mode 100644 index 0000000000..276d72fcf9 --- /dev/null +++ b/tests/web3/firefly_setGasPrice.expected.json @@ -0,0 +1,43 @@ +[ + { + "jsonrpc": "2.0", + "id": 1, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x6691b7" + }, + { + "jsonrpc": "2.0", + "id": 1, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x30d40" + }, + { + "jsonrpc": "2.0", + "id": 2, + "error": { + "code": -32000, + "message": "firefly_setGasPrice requires exactly 1 argument" + } + }, + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x30d40" + }, + { + "jsonrpc": "2.0", + "id": 3, + "error": { + "code": -32000, + "message": "firefly_setGasPrice requires exactly 1 argument" + } + } +] diff --git a/tests/web3/firefly_setGasPrice.in.json b/tests/web3/firefly_setGasPrice.in.json new file mode 100644 index 0000000000..eddb8aae41 --- /dev/null +++ b/tests/web3/firefly_setGasPrice.in.json @@ -0,0 +1,51 @@ +[ + { + "jsonrpc": "2.0", + "id": 1, + "method": "firefly_setGasPrice", + "params": [ + "0x6691b7" + ] + }, + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_gasPrice", + "params": [] + }, + { + "jsonrpc": "2.0", + "id": 1, + "method": "firefly_setGasPrice", + "params": [ + 200000 + ] + }, + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_gasPrice", + "params": [] + }, + { + "jsonrpc": "2.0", + "id": 2, + "method": "firefly_setGasPrice", + "params": [ + "0x6691b7", + "Hello" + ] + }, + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_gasPrice", + "params": [] + }, + { + "jsonrpc": "2.0", + "id": 3, + "method": "firefly_setGasPrice", + "params": [] + } +] diff --git a/tests/web3/firefly_setTime.expected.json b/tests/web3/firefly_setNetworkId.expected.json similarity index 70% rename from tests/web3/firefly_setTime.expected.json rename to tests/web3/firefly_setNetworkId.expected.json index 0abf42148b..975a5e0b59 100644 --- a/tests/web3/firefly_setTime.expected.json +++ b/tests/web3/firefly_setNetworkId.expected.json @@ -2,16 +2,16 @@ { "jsonrpc": "2.0", "id": 1, - "result": "0x0" + "result": "28346" }, { "jsonrpc": "2.0", - "id": 2, + "id": 1, "result": true }, { "jsonrpc": "2.0", "id": 3, - "result": "0x5dcd855e" + "result": "6721975" } ] diff --git a/tests/web3/firefly_setTime.in.json b/tests/web3/firefly_setNetworkId.in.json similarity index 57% rename from tests/web3/firefly_setTime.in.json rename to tests/web3/firefly_setNetworkId.in.json index 057a2b44f2..fb9cf2bcdf 100644 --- a/tests/web3/firefly_setTime.in.json +++ b/tests/web3/firefly_setNetworkId.in.json @@ -2,21 +2,21 @@ { "jsonrpc": "2.0", "id": 1, - "method": "firefly_getTime", + "method": "net_version", "params": [] }, { "jsonrpc": "2.0", - "id": 2, - "method": "firefly_setTime", + "id": 1, + "method": "firefly_setNetworkId", "params": [ - "0x5dcd855e" + 6721975 ] }, { "jsonrpc": "2.0", "id": 3, - "method": "firefly_getTime", + "method": "net_version", "params": [] } ] diff --git a/tests/web3/getBlock_multipleTransactions.expected.json b/tests/web3/getBlock_multipleTransactions.expected.json index 5f6b78a5de..f875fa36ff 100644 --- a/tests/web3/getBlock_multipleTransactions.expected.json +++ b/tests/web3/getBlock_multipleTransactions.expected.json @@ -19,15 +19,10 @@ "id": 2, "result": true }, - { - "jsonrpc": "2.0", - "id": 2, - "result": "1575488963" - }, { "jsonrpc": "2.0", "id": 3, - "result": "0xf4156d1e150a8d92070ac848fe10a6a994e7eb94184286e735e7437a011c63d7" + "result": "0x163cd58b01b3b9df9b8bc7a0097b118477cfc8a7ce62161e2293770ae28a0a3b" }, { "jsonrpc": "2.0", @@ -37,20 +32,20 @@ { "jsonrpc": "2.0", "id": 4, - "result": "0x2c5e04b53a8a4ad2c02d4541f23459a0381c60a73a96cdfd07a0d2c343911b34" + "result": "0x5f866af922ce6c022851f575331605d2f20f2b3a7c818fe087b6fce08476b062" }, { "jsonrpc": "2.0", "id": 5, "result": { "number": "0x1", - "hash": "0x564251ac28747e0bc6e034000797e6dc5d4b5c386c51530b7c3b8d6e7de92244", + "hash": "0x43d57abec3f7830aaeb097e79f39a1f7f180b95bbddb454120cbf17def3dcee5", "parentHash": "0x847434d8eb2a2054c519e3c9b76e0fadf868170af1cfe68242cbda45b11f85d4", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0x5ce4c8c27ecb3784bfcd8e128b01c3e6c90c0264d579d9f7232f53421c6e3109", + "transactionsRoot": "0x42c1a8db077aff72240585bc15df5e1f3eec4a09285e239453fbea441da57ca3", "stateRoot": "0x45fb450be0f9542426acf1a81c513ae9d1a2226d4b3ab7afe88f566ab2dcdd6b", "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", "miner": "0x0000000000000000000000000000000000000000", @@ -60,9 +55,9 @@ "size": "0x3e8", "gasLimit": "0x6691b7", "gasUsed": "0x5208", - "timestamp": "0x5de80dc3", + "timestamp": "0x5de80d75", "transactions": [ - "0xf4156d1e150a8d92070ac848fe10a6a994e7eb94184286e735e7437a011c63d7" + "0x163cd58b01b3b9df9b8bc7a0097b118477cfc8a7ce62161e2293770ae28a0a3b" ], "uncles": [] } @@ -72,13 +67,13 @@ "id": 6, "result": { "number": "0x2", - "hash": "0xbcfb13bb491ebee5d9217a721dcb25ffbcc09e6c4813f6b08b99d25e8b395a23", - "parentHash": "0x564251ac28747e0bc6e034000797e6dc5d4b5c386c51530b7c3b8d6e7de92244", + "hash": "0xcd1915c1ca178f087be09c93e52007d67bc70833923ebfb623047601af29e06b", + "parentHash": "0x43d57abec3f7830aaeb097e79f39a1f7f180b95bbddb454120cbf17def3dcee5", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0x44feb4e2e7d6a976b56b7d8c6a180e2585ebd67c63d526c9b77c6c5795af3cb2", + "transactionsRoot": "0xd1069e05dbc21633f253f75d8b96becd879e61a6b5c7af7826bab92bda763af7", "stateRoot": "0x3f310a0070d7ff288bb2345cf86fbaa3538cfec53a12a273e58bd842779c8714", "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", "miner": "0x0000000000000000000000000000000000000000", @@ -90,7 +85,7 @@ "gasUsed": "0x5208", "timestamp": "0x5de80dc5", "transactions": [ - "0x2c5e04b53a8a4ad2c02d4541f23459a0381c60a73a96cdfd07a0d2c343911b34" + "0x5f866af922ce6c022851f575331605d2f20f2b3a7c818fe087b6fce08476b062" ], "uncles": [] } diff --git a/tests/web3/getBlock_multipleTransactions.in.json b/tests/web3/getBlock_multipleTransactions.in.json index 2c5ed25ecc..acd5b45277 100644 --- a/tests/web3/getBlock_multipleTransactions.in.json +++ b/tests/web3/getBlock_multipleTransactions.in.json @@ -35,14 +35,6 @@ "method": "firefly_genesisBlock", "params": ["0x5de80d75"] }, - { - "jsonrpc": "2.0", - "id": 2, - "method": "evm_increaseTime", - "params": [ - 78 - ] - }, { "jsonrpc": "2.0", "id": 3, diff --git a/tests/web3/getBlock_singleTransaction.expected.json b/tests/web3/getBlock_singleTransaction.expected.json index e4982add1c..df3f2a0ec9 100644 --- a/tests/web3/getBlock_singleTransaction.expected.json +++ b/tests/web3/getBlock_singleTransaction.expected.json @@ -19,28 +19,23 @@ "id": 1, "result": true }, - { - "jsonrpc": "2.0", - "id": 2, - "result": "1575487944" - }, { "jsonrpc": "2.0", "id": 3, - "result": "0xf4156d1e150a8d92070ac848fe10a6a994e7eb94184286e735e7437a011c63d7" + "result": "0x163cd58b01b3b9df9b8bc7a0097b118477cfc8a7ce62161e2293770ae28a0a3b" }, { "jsonrpc": "2.0", "id": 4, "result": { "number": "0x1", - "hash": "0x5a6008aa6258bd860227271f5a11dd5ab1c7d0dcf0d477eb923c92e56c70fe5c", + "hash": "0x70797d7d7bfc7abf5ba090edda058b95192ce3830adfe861f6dbfefd256f5ea0", "parentHash": "0x9516924ce4a6b04bcd8e716e35f6b276cc9928b519c710b27127b2d4d2fd2f88", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "transactionsRoot": "0x5ce4c8c27ecb3784bfcd8e128b01c3e6c90c0264d579d9f7232f53421c6e3109", + "transactionsRoot": "0x42c1a8db077aff72240585bc15df5e1f3eec4a09285e239453fbea441da57ca3", "stateRoot": "0x45fb450be0f9542426acf1a81c513ae9d1a2226d4b3ab7afe88f566ab2dcdd6b", "receiptsRoot": "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2", "miner": "0x0000000000000000000000000000000000000000", @@ -50,9 +45,9 @@ "size": "0x3e8", "gasLimit": "0x6691b7", "gasUsed": "0x5208", - "timestamp": "0x5de809c8", + "timestamp": "0x5de80984", "transactions": [ - "0xf4156d1e150a8d92070ac848fe10a6a994e7eb94184286e735e7437a011c63d7" + "0x163cd58b01b3b9df9b8bc7a0097b118477cfc8a7ce62161e2293770ae28a0a3b" ], "uncles": [] } diff --git a/tests/web3/getBlock_singleTransaction.in.json b/tests/web3/getBlock_singleTransaction.in.json index dd752ca48e..16d62351c5 100644 --- a/tests/web3/getBlock_singleTransaction.in.json +++ b/tests/web3/getBlock_singleTransaction.in.json @@ -35,14 +35,6 @@ "method": "firefly_genesisBlock", "params": ["0x5de80984"] }, - { - "jsonrpc": "2.0", - "id": 2, - "method": "evm_increaseTime", - "params": [ - 68 - ] - }, { "jsonrpc": "2.0", "id": 3, diff --git a/tests/web3/runtest.sh b/tests/web3/runtest.sh index 7c8865ee3a..dd8bba2821 100755 --- a/tests/web3/runtest.sh +++ b/tests/web3/runtest.sh @@ -19,13 +19,13 @@ s.close() # Start Firefly PORT=$(get_port) -./kevm web3 "$PORT" "$@" & +./kevm web3 -p "$PORT" "$@" & kevm_client_pid="$!" while (! netcat -z 127.0.0.1 "$PORT") ; do sleep 0.1; done # Feed input in, store output in supplied file -./kevm web3-send "$PORT" "$input_file" | jq . > "$output_file" -./kevm web3-send "$PORT" 'firefly_shutdown' +./kevm web3-send -p "$PORT" "$input_file" | jq . > "$output_file" +./kevm web3-send -p "$PORT" 'firefly_shutdown' echo timeout 8 tail --pid="$kevm_client_pid" -f /dev/null || true diff --git a/tests/web3/sendRawTransaction2.expected.json b/tests/web3/sendRawTransaction2.expected.json index 03be7d853d..5f82158ef6 100644 --- a/tests/web3/sendRawTransaction2.expected.json +++ b/tests/web3/sendRawTransaction2.expected.json @@ -3,6 +3,11 @@ "id": 1, "result": true } +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} { "jsonrpc": "2.0", "id": 2, @@ -14,7 +19,7 @@ "result": { "transactionHash": "0xd9550d635cd2dad8167ddaad05a40c2c431152db1bd63e696d92930ae80e2c1c", "transactionIndex": "0x0", - "blockHash": "0x414c012582e381c308eeb523588ad61fbe64c57e831db54a768caef500f8baae", + "blockHash": "0xfbe25ecab506fbcd24df2fb4417ad0b68aeaac953206b659fc06e1e8921bbd75", "blockNumber": "0x1", "from": "0xcdedf6c39b65646e18d239315ffa275490be97e0", "to": "0xb596a41ebe34affcc8e68f1e732fd85fd5ce85d6", diff --git a/tests/web3/sendRawTransaction2.in.json b/tests/web3/sendRawTransaction2.in.json index d67b939187..d4a5382d1a 100644 --- a/tests/web3/sendRawTransaction2.in.json +++ b/tests/web3/sendRawTransaction2.in.json @@ -9,6 +9,14 @@ } ] } +{ + "jsonrpc": "2.0", + "id": 1, + "method": "firefly_genesisBlock", + "params": [ + "0x0" + ] +} { "jsonrpc": "2.0", "id": 2, diff --git a/tests/web3/sendRawTransaction_invalidSig.expected.json b/tests/web3/sendRawTransaction_invalidSig.expected.json index 300909de9c..0c217f7f10 100644 --- a/tests/web3/sendRawTransaction_invalidSig.expected.json +++ b/tests/web3/sendRawTransaction_invalidSig.expected.json @@ -1,3 +1,8 @@ +{ + "jsonrpc": "2.0", + "id": 0, + "result": true +} { "jsonrpc": "2.0", "id": 2, @@ -6,3 +11,8 @@ "message": "Invalid Signature" } } +{ + "jsonrpc": "2.0", + "id": 2, + "result": "0x4e210195f80330b6a33f7c1af4d655bd2b31a6610c64af2e2a801283f6a74567" +} diff --git a/tests/web3/sendRawTransaction_invalidSig.in.json b/tests/web3/sendRawTransaction_invalidSig.in.json index 4cafe39e70..05089f2e08 100644 --- a/tests/web3/sendRawTransaction_invalidSig.in.json +++ b/tests/web3/sendRawTransaction_invalidSig.in.json @@ -1,3 +1,14 @@ +{ + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0xe3253ad0f5eb36a2aad0e1ac1357d9e4d2369e253ebffbe51cc0058300aa51e0", + "balance": "0x56bc75e2d63100000" + } + ] +} { "jsonrpc": "2.0", "id": 2, @@ -6,3 +17,14 @@ "0xf867808609184e72a0008276c09404ec3d8612162d2a8b6845824118a323820777718201008025a074c385d50ad43bb9616fad2f3056a1a4336a78c19cf03dc65cf6d683db475498a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] } +{ + "jsonrpc": "2.0", + "id": 2, + "method": "eth_sendTransaction", + "params": [ + { + "from":"0xa6c4440af8b62f7ef0a19ff1ed28bc5fa986aa65", + "value":"0x1" + } + ] +} diff --git a/tests/web3/sendRawTransaction_noTo.expected.json b/tests/web3/sendRawTransaction_noTo.expected.json index e68c5bf794..98b3826e0f 100644 --- a/tests/web3/sendRawTransaction_noTo.expected.json +++ b/tests/web3/sendRawTransaction_noTo.expected.json @@ -3,6 +3,11 @@ "id": 1, "result": true } +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} { "jsonrpc": "2.0", "id": 2, @@ -14,7 +19,7 @@ "result": { "transactionHash": "0xf6f451f74bcbdaeacf2d3125a6b520a2dbbdce9245057f94db8dff2ccfb120d6", "transactionIndex": "0x0", - "blockHash": "0xed8ab51bf698c4bb82dd264817f8545c01a1fd8c1e50fe23be44ce783c9b4ccc", + "blockHash": "0x3136fd650cb7a50982de51532ac34c1581cd56061a340c0db30ff75810c91905", "blockNumber": "0x1", "from": "0x6704fbfcd5ef766b287262fa2281c105d57246a6", "to": "0xa990077c3205cbdf861e17fa532eeb069ce9ff96", @@ -45,7 +50,7 @@ "result": { "transactionHash": "0xfefb2da535e927b85fe68eb81cb2e4a5827c905f78381a01ef2322aa9b0aee8e", "transactionIndex": "0x0", - "blockHash": "0xeac0acddf2c8c9fa915a5ae1b617fa09d611f5b3317b471a01d6ea86b00f30d3", + "blockHash": "0x6c9bf3d6ae4c540700319659b6552764fdb39234ad7ee85c3e56346378f641b4", "blockNumber": "0x2", "from": "0xa990077c3205cbdf861e17fa532eeb069ce9ff96", "to": null, diff --git a/tests/web3/sendRawTransaction_noTo.in.json b/tests/web3/sendRawTransaction_noTo.in.json index 00ad45d9df..978be6f7ff 100644 --- a/tests/web3/sendRawTransaction_noTo.in.json +++ b/tests/web3/sendRawTransaction_noTo.in.json @@ -9,6 +9,14 @@ } ] } +{ + "jsonrpc": "2.0", + "id": 1, + "method": "firefly_genesisBlock", + "params": [ + "0x0" + ] +} { "jsonrpc": "2.0", "id": 2, diff --git a/tests/web3/sendRawTransaction_non27or28_V.expected.json b/tests/web3/sendRawTransaction_non27or28_V.expected.json new file mode 100644 index 0000000000..a679687846 --- /dev/null +++ b/tests/web3/sendRawTransaction_non27or28_V.expected.json @@ -0,0 +1,68 @@ +[ + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 0, + "result": true + }, + { + "jsonrpc": "2.0", + "id": 46, + "result": "0xedb019d914384685e357d7372351b969cc04f06f242dd12a252038b9cd6f463d" + }, + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "transactionHash": "0xedb019d914384685e357d7372351b969cc04f06f242dd12a252038b9cd6f463d", + "transactionIndex": "0x0", + "blockHash": "0x4973936b5773f9359eed67387104c2ea6ba28e705bfa9f27bb64f776b44c29d2", + "blockNumber": "0x1", + "from": "0xf3beac30c498d9e26865f34fcaa57dbb935b0d74", + "to": null, + "gasUsed": "0xf24bb", + "cumulativeGasUsed": "0xf24bb", + "contractAddress": "0x716b975d43037ea681e1082f28e4aa97479deb35", + "logs": [], + "status": "0x1", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "v": "0xbd40d51d", + "r": "0xb7fb1a1bb24d10dac79d5db596874901f2a737bab955f5f255f153b330ea8ffe", + "s": "0x69cb1b77e286033ae390e8562e46b9906b05d2b75dcd2f45697dfa6136c535ea" + } + } +] diff --git a/tests/web3/sendRawTransaction_non27or28_V.in.json b/tests/web3/sendRawTransaction_non27or28_V.in.json new file mode 100644 index 0000000000..a033395774 --- /dev/null +++ b/tests/web3/sendRawTransaction_non27or28_V.in.json @@ -0,0 +1,94 @@ +[ + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0x278a5de700e29faae8e40e366ec5012b5ec63d36ec77e8a2417154cc1d25383f", + "balance": "0x35ab028ac154b80000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0x7bc8feb5e1ce2927480de19d8bc1dc6874678c016ae53a2eec6a6e9df717bfac", + "balance": "0xd3c21bcecceda1000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0x94890218f2b0d04296f30aeafd13655eba4c5bbf1770273276fee52cbe3f2cb4", + "balance": "0xd3c21bcecceda1000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_addAccount", + "params": [ + { + "key": "0x12340218f2b0d04296f30aeafd13655eba4c5bbf1770273276fee52cbe3f2cb4", + "balance": "0xd3c21bcecceda1000000" + } + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_setGasLimit", + "params": [ + "0x895440" + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_setGasPrice", + "params": [ + "0x4a817c800" + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_setNetworkId", + "params": [ + "0x5ea06a7d" + ] + }, + { + "jsonrpc": "2.0", + "id": 0, + "method": "firefly_genesisBlock", + "params": [ + "0x5ea070ae" + ] + }, + { + "method": "eth_sendRawTransaction", + "params": [ + "0xf91174808504a817c800830f24bb8080b9111d608060405234801561001057600080fd5b506110fd806100206000396000f3fe608060405234801561001057600080fd5b506004361061004f5760e060020a6000350463440d14e281146100545780636d60b2491461007f5780638f8b41ff1461009f578063914cac03146100bf575b600080fd5b610067610062366004610bb6565b6100d2565b60405161007693929190610f8f565b60405180910390f35b61009261008d366004610bb6565b6100ef565b6040516100769190610f7e565b6100b26100ad366004610bf2565b61011a565b6040516100769190610f40565b6100b26100cd366004610c26565b61012d565b60008060606100e2600085610146565b9196909550909350915050565b6100f7610a3d565b6060610104600084610146565b925061011391508290506102a6565b9392505050565b600061012582610435565b90505b919050565b607860020a82026001607860020a038216175b92915050565b6000806060600060f885600181518110151561015e57fe5b90602001906020020151908060020a82049150506001900460ff169050600060e086600181518110151561018e57fe5b90602001906020020151908060020a82049150506001900461ffff169050806040519080825280601f01601f1916602001820160405280156101d7576020820181803883390190505b5092508087830160440160208501378280519060200120935060a086600181518110151561020157fe5b90602001906020020151908060020a8204915050600190049450600061025785876001604060020a031660f08a600181518110151561023c57fe5b6020908102909101015160ff60029290920a9004168a61060f565b905086600081518110151561026857fe5b60209081029091010151811461029c5760405160e560020a62461bcd02815260040161029390610f6e565b60405180910390fd5b5050509250925092565b6102ae610a3d565b602082015160009060f860020a900460028114156102cf576002915061030e565b80600314156102e1576003915061030e565b80600d14156102f357600d915061030e565b60405160e560020a62461bcd02815260040161029390610f5e565b5060218301516040805160fc60020a90920480835260208082028401019091529060609082801561035957816020015b610346610a5f565b81526020019060019003908161033e5790505b509050600260005b825181101561038f57610385811561037a57600361037c565b855b8883858761067e565b9150600101610361565b5060218601516040805160f860020a909204600f16808352602080820284010190915293506060908480156103de57816020015b6103cb610a9e565b8152602001906001900390816103c35790505b50905060005b8151811015610403576103f98882858561087d565b92506001016103e4565b5060606040519081016040528086600d81111561041c57fe5b8152602081019490945260409093015250949350505050565b602081015160009060f860020a9004600381146104675760405160e560020a62461bcd02815260040161029390610f4e565b506021820151825160408051828152601f19601f840116810160200190915260fc60020a9092049160609180156104a5576020820181803883390190505b509050602084015160001a6020820153602084015160011a60218201536000805b838110156104f9578582016022818101518585019182015260429182015160001a910153606291909101906001016104c6565b50806022015b855160400181101561051b5785810151838201526020016104ff565b50506105278451610919565b8160405160200180807f19457468657265756d205369676e6564204d6573736167653a0a000000000000815250601a0183805190602001908083835b602083106105825780518252601f199092019160209182019101610563565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106105ca5780518252601f1990920191602091820191016105ab565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040528051906020012092505050919050565b600080835b835181101561067357838181518110151561062b57fe5b60209081029091010151915060028606151561065557866000528160205260406000209650610665565b8160005286602052604060002096505b600286049550600101610614565b509495945050505050565b60008080600288600d81111561069057fe5b14156106b25750505060048483018101519083019063ffffffff1660006106c8565b5050508184016020810151602191820151918401915b6106d0610ac5565b5060408051808201825283815260ff8316602080830191909152825160008152908101909252906106ff610a5f565b506040805160c08101825283815260006020820181905291810182905260608101919091526080810182905260a08101829052600d8b600d81111561074057fe5b141561081457878a01602301516040805161ffff8316808252601f19601f820116820160200190925290801561077d576020820181803883390190505b509250888b0160430160208401610799828261ffff86166109e4565b848460a001819052508261ffff168b6025010198508c89015192508261ffff166040519080825280601f01601f1916602001820160405280156107e3576020820181803883390190505b5094505060208c8901810191508401610801828261ffff86166109e4565b50506080820183905261ffff1695909501945b60038b600d81111561082257fe5b141561085557878a01604181015160618201516062928301516020850192909252604084015260ff166060830152880195505b80878a81518110151561086457fe5b6020908102909101015250939998505050505050505050565b83820160208101516022820151603692830151929094019360009261ffff91909116908361c0008311156108b8576020870196508887015190505b6108c0610a9e565b6080604051908101604052808681526020018561ffff16815260200184600160a060020a0316815260200183815250905080878a81518110151561090057fe5b6020908102919091010152509598975050505050505050565b60608115156109435750604080518082019091526001815260fc60020a6003026020820152610128565b8160005b811561095b57600101600a82049150610947565b6060816040519080825280601f01601f191660200182016040528015610988576020820181803883390190505b50905060001982015b85156109db57815160001982019160f860020a6030600a8a0601029184919081106109b857fe5b906020010190600160f860020a031916908160001a905350600a86049550610991565b50949350505050565b600060208204815b81811015610a0a5760208102868101518682015292506001016109ec565b506020908102938401805195909401516008601f9094169091039290920260020a60000391821691199390931617905250565b6040805160608101909152806000815260200160608152602001606081525090565b60e060405190810160405280610a73610ac5565b8152600060208201819052604082018190526060808301919091526080820181905260a09091015290565b60408051608081018252600080825260208201819052918101829052606081019190915290565b604080518082019091526000808252602082015290565b6000601f82018313610aed57600080fd5b8135610b00610afb82610fe2565b610fbc565b91508181835260208401935060208101905083856020840282011115610b2557600080fd5b60005b83811015610b515781610b3b8882610b5b565b8452506020928301929190910190600101610b28565b5050505092915050565b6000610113823561103e565b6000601f82018313610b7857600080fd5b8135610b86610afb82611002565b91508082526020830160208301858383011115610ba257600080fd5b610bad838284611081565b50505092915050565b600060208284031215610bc857600080fd5b81356001604060020a03811115610bde57600080fd5b610bea84828501610adc565b949350505050565b600060208284031215610c0457600080fd5b81356001604060020a03811115610c1a57600080fd5b610bea84828501610b67565b60008060408385031215610c3957600080fd5b6000610c458585610b5b565b9250506020610c5685828601610b5b565b9150509250929050565b610c6981611033565b82525050565b6000610c7a8261102f565b80845260208401935083602082028501610c9385611029565b60005b84811015610cca578383038852610cae838351610de3565b9250610cb982611029565b602098909801979150600101610c96565b50909695505050505050565b6000610ce18261102f565b808452602084019350610cf383611029565b60005b82811015610d2357610d09868351610e95565b610d1282611029565b608096909601959150600101610cf6565b5093949350505050565b610c698161103e565b6000610d418261102f565b808452610d5581602086016020860161108d565b610d5e816110b9565b9093016020019392505050565b610c6981611076565b60118152607860020a706e6f74207472616e73666572207479706502602082015260400190565b600f8152608860020a6e756e6b6e6f776e207478207479706502602082015260400190565b600d8152609960020a6c34b73b30b634b210383937b7b302602082015260400190565b805160009060e0840190610df78582610e6b565b506020830151610e0a6040860182610d2d565b506040830151610e1d6060860182610d2d565b506060830151610e306080860182610f37565b50608083015184820360a0860152610e488282610d36565b91505060a083015184820360c0860152610e628282610d36565b95945050505050565b80516040830190610e7c8482610d2d565b506020820151610e8f6020850182610f37565b50505050565b80516080830190610ea68482610d2d565b506020820151610eb96020850182610f25565b506040820151610ecc6040850182610c60565b506060820151610e8f6060850182610d2d565b80516000906060840190610ef38582610d6b565b5060208301518482036020860152610f0b8282610c6f565b91505060408301518482036040860152610e628282610cd6565b610c6981611051565b610c6981611064565b610c6981611070565b602081016101408284610d2d565b6020808252810161012581610d74565b6020808252810161012581610d9b565b6020808252810161012581610dc0565b602080825281016101138184610edf565b60608101610f9d8286610f2e565b610faa6020830185610d2d565b8181036040830152610e628184610d36565b6040518181016001604060020a0381118282101715610fda57600080fd5b604052919050565b60006001604060020a03821115610ff857600080fd5b5060209081020190565b60006001604060020a0382111561101857600080fd5b506020601f91909101601f19160190565b60200190565b5190565b600061012582611058565b90565b6000600e821061104d57fe5b5090565b61ffff1690565b600160a060020a031690565b6001604060020a031690565b60ff1690565b600061012582611041565b82818337506000910152565b60005b838110156110a8578181015183820152602001611090565b83811115610e8f5750506000910152565b601f01601f19169056fea265627a7a72305820d27eec6a4fad27bb58f82a07b8bf9a08fe88f9cd25676109c0b8103c2ef19ce66c6578706572696d656e74616cf5003784bd40d51da0b7fb1a1bb24d10dac79d5db596874901f2a737bab955f5f255f153b330ea8ffea069cb1b77e286033ae390e8562e46b9906b05d2b75dcd2f45697dfa6136c535ea" + ], + "id": 46, + "jsonrpc": "2.0" + }, + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getTransactionReceipt", + "params": [ + "0xedb019d914384685e357d7372351b969cc04f06f242dd12a252038b9cd6f463d" + ] + } +] diff --git a/tests/web3/undefinedOpcode.expected.json b/tests/web3/undefinedOpcode.expected.json index ac3c0aedd5..d2345e4919 100644 --- a/tests/web3/undefinedOpcode.expected.json +++ b/tests/web3/undefinedOpcode.expected.json @@ -18,7 +18,7 @@ "data": { "0x5daefe6da6e340448ea5c8ff3926de2aa48e4423476a438f1533a18b4347c25f": { "error": "EVMC_UNDEFINED_INSTRUCTION", - "program_counter": 1, + "program_counter": 12, "return": "0x" } } diff --git a/web3.md b/web3.md index ef12b3563c..61636ea94e 100644 --- a/web3.md +++ b/web3.md @@ -17,12 +17,14 @@ module WEB3 - 0 .List - .Map - 0 + 20000000000 + 90000 + 0 // Gets added to #time() when updating + .Map + 0 "":String @@ -45,7 +47,7 @@ module WEB3 .List - $SHUTDOWNABLE:Bool + $SHUTDOWNABLE:Bool $NOTIFICATIONS:Bool ``` @@ -68,6 +70,7 @@ The `blockList` cell stores a list of previous blocks and network states. rule #pushBlockchainState => . ... (.List => ListItem({ NETWORK | BLOCK })) ... NETWORK + (.List => ListItem(#blockchainItemHash({ NETWORK | BLOCK }))) ... BLOCK syntax BlockchainItem ::= #getBlockByNumber ( BlockIdentifier , List , BlockchainItem ) [function] @@ -75,7 +78,7 @@ The `blockList` cell stores a list of previous blocks and network states. rule #getBlockByNumber( _:Int , .List , _ ) => .BlockchainItem rule #getBlockByNumber( LATEST , .List , BLOCK ) => BLOCK rule #getBlockByNumber( LATEST , ListItem( BLOCK ) _ , _ ) => BLOCK - rule #getBlockByNumber( PENDING , _ , BLOCK ) => BLOCK + rule #getBlockByNumber( PENDING => LATEST, _ , _ ) rule #getBlockByNumber( EARLIEST , .List , BLOCK ) => BLOCK rule #getBlockByNumber( EARLIEST , _ ListItem( BLOCK ) , _ ) => BLOCK @@ -138,13 +141,11 @@ WEB3 JSON RPC syntax EthereumSimulation ::= accept() [symbol] // ----------------------------------------------- rule accept() => getRequest() ... - SOCK - _ => #accept(SOCK) syntax KItem ::= getRequest() // ----------------------------- - rule getRequest() => #loadRPCCall(#getRequest(SOCK)) ... - SOCK + rule getRequest() => #loadRPCCall(#getRequest(FD)) ... + FD _ => undef syntax IOJSON ::= #getRequest(Int) [function, hook(JSON.read)] @@ -164,8 +165,7 @@ WEB3 JSON RPC _ => #getJSON("method" , J) _ => #getJSON("params" , J) - rule #loadRPCCall(#EOF) => #shutdownWrite(SOCK) ~> #close(SOCK) ~> accept() ... - SOCK + rule #loadRPCCall(#EOF) => accept() ... rule #loadRPCCall([ _, _ ] #as J) => #loadFromBatch ... _ => J @@ -182,9 +182,9 @@ WEB3 JSON RPC rule #loadFromBatch ~> _ => #loadRPCCall(J) [ J , JS => JS ] - rule #loadFromBatch ~> _ => #putResponse(List2JSON(RESPONSE), SOCK) ~> getRequest() + rule #loadFromBatch ~> _ => #putResponse(List2JSON(RESPONSE), FD) ~> getRequest() [ .JSONs ] - SOCK + FD RESPONSE requires size(RESPONSE) >Int 0 @@ -202,15 +202,15 @@ WEB3 JSON RPC syntax KItem ::= #sendResponse ( JSONs ) // ---------------------------------------- - rule #sendResponse(J) ~> _ => #putResponse({ "jsonrpc": "2.0", "id": CALLID, J }, SOCK) ~> getRequest() - CALLID - SOCK - undef + rule #sendResponse(J) ~> _ => #putResponse({ "jsonrpc": "2.0", "id": CALLID, J }, FD) ~> getRequest() + CALLID + FD + undef requires CALLID =/=K undef - rule #sendResponse(J) ~> _ => #putResponse({ "jsonrpc": "2.0", J }, SOCK) ~> getRequest() + rule #sendResponse(J) ~> _ => #putResponse({ "jsonrpc": "2.0", J }, FD) ~> getRequest() undef - SOCK + FD undef true @@ -328,9 +328,10 @@ WEB3 JSON RPC rule #runRPCCall => #firefly_setTime ... "firefly_setTime" rule #runRPCCall => #firefly_genesisBlock ... "firefly_genesisBlock" rule #runRPCCall => #firefly_setGasLimit ... "firefly_setGasLimit" + rule #runRPCCall => #firefly_setGasPrice ... "firefly_setGasPrice" + rule #runRPCCall => #firefly_setNetworkId ... "firefly_setNetworkId" rule #runRPCCall => #firefly_blake2compress ... "firefly_blake2compress" - rule #runRPCCall => #debug_traceTransaction ... "debug_traceTransaction" rule #runRPCCall => #miner_start ... "miner_start" rule #runRPCCall => #miner_stop ... "miner_stop" rule #runRPCCall => #personal_importRawKey ... "personal_importRawKey" @@ -344,10 +345,10 @@ WEB3 JSON RPC syntax KItem ::= "#firefly_shutdown" // ------------------------------------ - rule #firefly_shutdown ~> _ => #putResponse({ "jsonrpc": "2.0" , "id": CALLID , "result": "Firefly client shutting down!" }, SOCK) + rule #firefly_shutdown ~> _ => #putResponse({ "jsonrpc": "2.0" , "id": CALLID , "result": "Firefly client shutting down!" }, FD) true CALLID - SOCK + FD _ => 0 rule #firefly_shutdown => #rpcResponseError(-32800, "Firefly client not started with `--shutdownable`!") ... @@ -369,7 +370,7 @@ WEB3 JSON RPC syntax KItem ::= "#eth_blockNumber" // ----------------------------------- - rule #eth_blockNumber => #rpcResponseSuccess(#unparseQuantity( BLOCKNUM )) ... + rule #eth_blockNumber => #rpcResponseSuccess(#unparseQuantity( BLOCKNUM -Int 1 )) ... BLOCKNUM syntax KItem ::= "#eth_accounts" @@ -474,8 +475,8 @@ WEB3 JSON RPC // ---------------------------------------------------- rule #hashMessage( S ) => #unparseByteStack(#parseHexBytes(Keccak256("\x19Ethereum Signed Message:\n" +String Int2String(lengthString(S)) +String S))) - syntax SnapshotItem ::= "{" BlockListCell "|" NetworkCell "|" BlockCell "|" TxReceiptsCell "}" - // ---------------------------------------------------------------------------------------------- + syntax SnapshotItem ::= "{" BlockListCell "|" NetworkCell "|" BlockCell "|" TxReceiptsCell "|" Int "}" + // ------------------------------------------------------------------------------------------------------ syntax KItem ::= "#evm_snapshot" // -------------------------------- @@ -485,26 +486,37 @@ WEB3 JSON RPC syntax KItem ::= "#pushNetworkState" // ------------------------------------ rule #pushNetworkState => . ... - ... (.List => ListItem({ BLOCKLIST | NETWORK | BLOCK | RECEIPTS })) + ... (.List => ListItem({ BLOCKLIST | NETWORK | BLOCK | RECEIPTS | TIMEDIFF })) NETWORK BLOCK BLOCKLIST + TIMEDIFF RECEIPTS syntax KItem ::= "#popNetworkState" // ----------------------------------- rule #popNetworkState => . ... - ... ( ListItem({ BLOCKLIST | NETWORK | BLOCK | RECEIPTS }) => .List ) - ( _ => NETWORK ) - ( _ => BLOCK ) - ( _ => BLOCKLIST ) - ( _ => RECEIPTS ) + ... ( ListItem({ BLOCKLIST | NETWORK | BLOCK | RECEIPTS | TIMEDIFF }) => .List ) + _ => NETWORK + _ => #getBlockhashlist( BLOCKLIST ) + _ => BLOCK + _ => BLOCKLIST + _ => TIMEDIFF + _ => RECEIPTS + + syntax List ::= #getBlockhashlist( List ) [function] + | #getBlockhashlistFromParents( List ) [function] + // --------------------------------------------------------------- + rule #getBlockhashlist( .List ) => .List + rule #getBlockhashlist( (ListItem( BLOCK ) REST) #as BLOCKLIST ) => ListItem(#blockchainItemHash(BLOCK)) #getBlockhashlistFromParents(BLOCKLIST) + rule #getBlockhashlistFromParents( .List ) => .List + rule #getBlockhashlistFromParents( ListItem( { _ | HP ... } ) REST ) => ListItem(HP) #getBlockhashlistFromParents(REST) syntax KItem ::= "#evm_revert" // ------------------------------ rule #evm_revert => #popNetworkState ~> #rpcResponseSuccess(true) ... - [ DATA:Int, .JSONs ] - SNAPSHOTS + [ DATA:Int, .JSONs ] + SNAPSHOTS requires DATA ==Int size(SNAPSHOTS) rule #evm_revert ... @@ -525,9 +537,9 @@ WEB3 JSON RPC rule #evm_increaseTime ... [ (null => 0), .JSONs ] - rule #evm_increaseTime => #rpcResponseSuccess(Int2String(TS +Int DATA)) ... - [ DATA:Int, .JSONs ] - ( TS:Int => ( TS +Int DATA ) ) + rule #evm_increaseTime => #rpcResponseSuccess(Int2String(TIMEDIFF +Int DATA)) ... + [ DATA:Int, .JSONs ] + TIMEDIFF => TIMEDIFF +Int DATA syntax KItem ::= "#eth_newBlockFilter" // -------------------------------------- @@ -606,7 +618,7 @@ eth_sendTransaction EVMC_REVERT RD - PCOUNT + PCOUNT rule _:String ~> #eth_sendTransaction_final => #rpcResponseError(-32000, "base fee exceeds gas limit") ... EVMC_OUT_OF_GAS @@ -617,18 +629,38 @@ eth_sendTransaction rule _:String ~> #eth_sendTransaction_final => #rpcResponseError(-32000, "VM exception: " +String StatusCode2String( SC )) ... SC:ExceptionalStatusCode [owise] - rule loadTransaction _ { "gas" : (TG:String => #parseHexWord(TG)), _ } ... - rule loadTransaction _ { "gasPrice" : (TP:String => #parseHexWord(TP)), _ } ... - rule loadTransaction _ { "nonce" : (TN:String => #parseHexWord(TN)), _ } ... - rule loadTransaction _ { "v" : (TW:String => #parseHexWord(TW)), _ } ... - rule loadTransaction _ { "value" : (TV:String => #parseHexWord(TV)), _ } ... - rule loadTransaction _ { "to" : (TT:String => #parseHexWord(TT)), _ } ... requires TT =/=String "" - rule loadTransaction _ { "to" : "" , REST => REST } ... - rule loadTransaction _ { "data" : (TI:String => #parseByteStack(TI)), _ } ... + rule loadTransaction _ { "gas" : (TG:String => #parseHexWord(TG)), _ } ... + rule loadTransaction _ { "gasPrice" : (TP:String => #parseHexWord(TP)), _ } ... + rule loadTransaction _ { "nonce" : (TN:String => #parseHexWord(TN)), _ } ... + rule loadTransaction _ { "v" : (TW:String => #parseHexWord(TW)), _ } ... + rule loadTransaction _ { "value" : (TV:String => #parseHexWord(TV)), _ } ... + rule loadTransaction _ { "to" : (TT:String => #parseHexWord(TT)), _ } ... requires TT =/=String "" + rule loadTransaction _ { "to" : "" , REST => REST } ... + rule loadTransaction _ { "data" : (TI:String => #parseByteStack(TI)), _ } ... rule loadTransaction _ { "r" : (TR:String => #padToWidth(32, #parseByteStack(TR))), _ } ... rule loadTransaction _ { "s" : (TS:String => #padToWidth(32, #parseByteStack(TS))), _ } ... - rule loadTransaction _ { ("from" : _, REST => REST) } ... - rule loadTransaction _ { (("amount" : TV) => "value": TV), REST } ... + rule loadTransaction _ { ("from" : _, REST => REST) } ... + rule loadTransaction _ { (("amount" : TV) => "value": TV) , REST } ... + rule loadTransaction _ { _ : _ , REST => REST } ... [owise] + + syntax EthereumCommand ::= "makeTX" Int + // --------------------------------------- + rule makeTX TXID => . ... + ... (.List => ListItem(TXID)) + ... (.List => ListItem(TXID)) + GPRICE + GLIMIT + + ( .Bag + => + TXID:Int + GPRICE + GLIMIT + ... + + ) + ... + syntax KItem ::= "#loadNonce" Int Int // ------------------------------------- @@ -648,16 +680,14 @@ eth_sendTransaction syntax JSON ::= #generateException( String, Int, Bytes, EndStatusCode ) [function] // ---------------------------------------------------------------------------------- - rule #generateException(TXHASH, PCOUNT, RD, SC) => { "message": "VM Exception while processing transaction: " +String StatusCode2TruffleString(SC), + rule #generateException(TXHASH, PCOUNT, RD, SC) => { "message": "VM Exception while processing transaction: " +String StatusCode2TruffleString(SC) +String " " +String #parseReason(RD), "code": -32000, "data": { TXHASH: { "error": StatusCode2TruffleString(SC), "program_counter": PCOUNT +Int 1, "return": #unparseDataByteArray( RD ), - "reason": Bytes2String(substrBytes(RD, - 36 +Int #asInteger(substrBytes(RD,5,36)), - 36 +Int #asInteger(substrBytes(RD,5,36)) +Int #asInteger(substrBytes(RD,37,68)))) + "reason": #parseReason(RD) } } } @@ -674,6 +704,11 @@ eth_sendTransaction } requires notBool lengthBytes(RD) >Int 68 + syntax String ::= #parseReason ( Bytes ) [function] + // --------------------------------------------------- + rule #parseReason(RD) => Bytes2String(substrBytes(RD, + 36 +Int #asInteger(substrBytes(RD,5,36)), + 36 +Int #asInteger(substrBytes(RD,5,36)) +Int #asInteger(substrBytes(RD,37,68)))) ``` - signTX TXID ACCTFROM: Signs the transaction with TXID using ACCTFROM's private key @@ -740,7 +775,7 @@ eth_sendRawTransaction rule #eth_sendRawTransaction => #rpcResponseError(-32000, "Invalid Signature") ... [owise] rule #eth_sendRawTransactionLoad - => mkTX !ID:Int + => makeTX !ID:Int ~> loadTransaction !ID { "data" : Raw2Hex(TI) , "gas" : Raw2Hex(TG) , "gasPrice" : Raw2Hex(TP) , "nonce" : Raw2Hex(TN) , "r" : Raw2Hex(TR) , "s" : Raw2Hex(TS) , "to" : Raw2Hex'(TT) , "v" : Raw2Hex(TW) , "value" : Raw2Hex(TV) @@ -754,10 +789,11 @@ eth_sendRawTransaction rule #eth_sendRawTransactionLoad => #rpcResponseError(-32000, "Invalid Signature") ... [owise] rule #eth_sendRawTransactionVerify TXID - => #prepareTx TXID #sender(TN, TP, TG, TT, TV, #unparseByteStack(TD), TW, TR, TS) + => #prepareTx TXID #sender(TN, TP, TG, TT, TV, #unparseByteStack(TD), TW, TR, TS, CID) ~> #eth_sendRawTransactionSend TXID ... + CID TXID TN @@ -770,9 +806,12 @@ eth_sendRawTransaction TR TS - requires ECDSARecover( Hex2Raw( #hashUnsignedTx(TN, TP, TG, TT, TV, TD) ), TW, #unparseByteStack(TR), #unparseByteStack(TS) ) =/=String "" + requires #sender(TN, TP, TG, TT, TV, #unparseByteStack(TD), TW, TR, TS, CID) =/=K .Account - rule #eth_sendRawTransactionVerify _ => #rpcResponseError(-32000, "Invalid Signature") ... [owise] + rule #eth_sendRawTransactionVerify TXID => #rpcResponseError(-32000, "Invalid Signature") ... + ListItem(TXID) => .List ... + ListItem(TXID) => .List ... + ( TXID ... => .Bag ) ... [owise] rule #eth_sendRawTransactionSend TXID => #rpcResponseSuccess("0x" +String #hashSignedTx(TN, TP, TG, TT, TV, TD, TW, TR, TS)) ... @@ -810,6 +849,9 @@ Retrieving Blocks ```k syntax KItem ::= "#eth_getBlockByNumber" // ---------------------------------------- + rule #eth_getBlockByNumber ... + [ (null => "0x0"), _:Bool, .JSONs ] + rule #eth_getBlockByNumber => #eth_getBlockByNumber_finalize( #getBlockByNumber(#parseBlockIdentifier(TAG), BLOCKLIST, { NETWORK | BLOCK })) ... [ TAG:String, TXOUT:Bool, .JSONs ] BLOCKLIST @@ -904,9 +946,18 @@ Transaction Receipts - the status code of the transaction. ```k + syntax KItem ::= "#makeTxReceipts" + | "#makeTxReceiptsAux" List + // ------------------------------------------ + rule #makeTxReceipts => #makeTxReceiptsAux TXLIST ... + TXLIST + rule #makeTxReceiptsAux .List => . ... + rule #makeTxReceiptsAux (ListItem(TXID) TXLIST) => #makeTxReceipt TXID ~> #makeTxReceiptsAux TXLIST ... + syntax KItem ::= "#makeTxReceipt" Int // ------------------------------------- rule #makeTxReceipt TXID => . ... + CID ( .Bag => @@ -916,8 +967,8 @@ Transaction Receipts #bloomFilter(LOGS) bool2Word(STATUSCODE ==K EVMC_SUCCESS) TXID - #parseHexWord(#unparseDataByteArray(#ecrecAddr(#sender(TN, TP, TG, TT, TV, #unparseByteStack(TD), TW , TR, TS)))) - BN +Int 1 + #parseHexWord(#unparseDataByteArray(#ecrecAddr(#sender(TN, TP, TG, TT, TV, #unparseByteStack(TD), TW , TR, TS, CID)))) + BN ) ... @@ -1133,7 +1184,7 @@ Transaction Receipts rule loadCallState TXID:Int => loadCallState { - "from": #unparseDataByteArray(#ecrecAddr(#sender(TN, TP, TG, TT, TV, #unparseByteStack(DATA), TW , TR, TS))), + "from": #unparseDataByteArray(#ecrecAddr(#sender(TN, TP, TG, TT, TV, #unparseByteStack(DATA), TW , TR, TS, CID))), "to": TT, "gas": TG, "gasPrice": TP, @@ -1142,6 +1193,7 @@ Transaction Receipts } ... + CID TXID TN @@ -1173,7 +1225,7 @@ Transaction Execution syntax KItem ::= "#loadTx" Account JSON // --------------------------------------- rule #loadTx ACCTFROM J - => mkTX !ID:Int + => makeTX !ID:Int ~> #loadNonce ACCTFROM !ID ~> loadTransaction !ID J ~> signTX !ID ACCTFROM @@ -1205,7 +1257,7 @@ Transaction Execution requires ( GLIMIT -Int G0(SCHED, DATA, (ACCTTO ==K .Account)) ) #validateTx TXID => #executeTx TXID ~> #makeTxReceipt TXID ~> #finishTx ... + rule #validateTx TXID => #updateTimestamp ~> #executeTx TXID ~> #mineAndUpdate ... SCHED _ => GLIMIT -Int G0(SCHED, DATA, (ACCTTO ==K .Account) ) @@ -1221,7 +1273,7 @@ Transaction Execution // --------------------------------- rule #executeTx TXID:Int => #create ACCTFROM #newAddr(ACCTFROM, NONCE) VALUE CODE - ~> #catchHaltTx #newAddr(ACCTFROM, NONCE) + ~> #finishTx ~> #finalizeTx(false) ... @@ -1249,7 +1301,7 @@ Transaction Execution rule #executeTx TXID:Int => #call ACCTFROM ACCTTO ACCTTO VALUE VALUE DATA false - ~> #catchHaltTx .Account + ~> #finishTx ~> #finalizeTx(false) ... @@ -1276,33 +1328,42 @@ Transaction Execution _ => SetItem(MINER) requires ACCTTO =/=K .Account - syntax KItem ::= "#finishTx" - // ---------------------------- - rule STATUSCODE - #finishTx => #mineBlock ~> #updateTimestamp ... - EXECMODE - requires EXECMODE =/=K NOGAS - andBool ( STATUSCODE ==K EVMC_SUCCESS orBool STATUSCODE ==K EVMC_REVERT ) - - rule #finishTx => #clearGas ... [owise] + syntax EthereumCommand ::= "#finishTx" + // -------------------------------------- + rule _:ExceptionalStatusCode #halt ~> #finishTx => #popCallStack ~> #popWorldState ... + rule EVMC_REVERT #halt ~> #finishTx => #popCallStack ~> #popWorldState ~> #refund GAVAIL ... GAVAIL - syntax KItem ::= "#catchHaltTx" Account - // --------------------------------------- - rule _:ExceptionalStatusCode - #halt ~> #catchHaltTx _ => #popCallStack ~> #popWorldState ... + rule EVMC_SUCCESS + #halt ~> #finishTx => #mkCodeDeposit ACCT ... + ACCT + ListItem(TXID:Int) ... + + TXID + .Account + ... + - rule EVMC_REVERT - #halt ~> #catchHaltTx _ => #popCallStack ~> #popWorldState ~> #refund GAVAIL ... - PCOUNT + rule EVMC_SUCCESS + #halt ~> #finishTx => #popCallStack ~> #dropWorldState ~> #refund GAVAIL ... + ACCT GAVAIL - _ => PCOUNT + ListItem(TXID:Int) ... + + TXID + TT + ... + + requires TT =/=K .Account - rule EVMC_SUCCESS - #halt ~> #catchHaltTx .Account => . ... + syntax KItem ::= "#mineAndUpdate" + // --------------------------------- + rule STATUSCODE + #mineAndUpdate => #mineBlock ... + EXECMODE + requires EXECMODE =/=K NOGAS + andBool ( STATUSCODE ==K EVMC_SUCCESS orBool STATUSCODE ==K EVMC_REVERT ) - rule EVMC_SUCCESS - #halt ~> #catchHaltTx ACCT => #mkCodeDeposit ACCT ... - requires ACCT =/=K .Account + rule #mineAndUpdate => #clearGas ... [owise] syntax KItem ::= "#clearLogs" // ----------------------------- @@ -1419,7 +1480,7 @@ Transaction Execution PCOUNT, RD, SC)) ... - PCOUNT + PCOUNT RD TXID @@ -1497,7 +1558,7 @@ NOGAS Mode NOGAS [priority(25)] - rule #validateTx TXID => #executeTx TXID ~> #makeTxReceipt TXID ~> #finishTx ... + rule #validateTx TXID => #updateTimestamp ~> #executeTx TXID ~> #mineAndUpdate ... NOGAS [priority(25)] @@ -1670,7 +1731,7 @@ Timestamp Calls // ----------------------------------- rule #firefly_setTime => #rpcResponseSuccess(true) ... [ TIME:String, .JSONs ] - _ => #parseHexWord( TIME ) + _ => #parseHexWord( TIME ) -Int #time() rule #firefly_setTime => #rpcResponseSuccess(false) ... [owise] ``` @@ -1681,28 +1742,62 @@ Gas Limit Call ```k syntax KItem ::= "#firefly_setGasLimit" // --------------------------------------- - rule #firefly_setGasLimit => #rpcResponseSuccess(true) ... - [ GLIMIT:String, .JSONs ] - _ => #parseWord( GLIMIT ) + rule #firefly_setGasLimit ... + [ GLIMIT:String => #parseWord( GLIMIT ), .JSONs ] rule #firefly_setGasLimit => #rpcResponseSuccess(true) ... - [ GLIMIT:Int, .JSONs ] - _ => GLIMIT + [ GLIMIT:Int, .JSONs ] + _ => GLIMIT + _ => GLIMIT rule #firefly_setGasLimit => #rpcResponseError(-32000, "firefly_setGasLimit requires exactly 1 argument") ... [owise] ``` +Gas Price Call +-------------- + +```k + syntax KItem ::= "#firefly_setGasPrice" + // --------------------------------------- + rule #firefly_setGasPrice ... + [ GPRICE:String => #parseWord( GPRICE ), .JSONs ] + + rule #firefly_setGasPrice => #rpcResponseSuccess(true) ... + [ GPRICE:Int, .JSONs ] + _ => GPRICE + _ => GPRICE + + rule #firefly_setGasPrice => #rpcResponseError(-32000, "firefly_setGasPrice requires exactly 1 argument") ... [owise] +``` + +Network Id +---------- + +```k + syntax KItem ::= "#firefly_setNetworkId" + // ---------------------------------------- + rule #firefly_setNetworkId ... + [ VALUE:String => #parseWord( VALUE ), .JSONs ] + + rule #firefly_setNetworkId => #rpcResponseSuccess(true) ... + [ VALUE:Int, .JSONs ] + _ => VALUE + + rule #firefly_setNetworkId => #rpcResponseError(-32000, "firefly_setNetworkId requires exactly 1 argument") ... [owise] +``` + Mining ------ ```k syntax KItem ::= "#evm_mine" // ---------------------------- - rule #evm_mine => #mineBlock ~> #rpcResponseSuccess("0x0") ... [owise] + rule #evm_mine => #updateTimestamp ~> #mineBlock ~> #rpcResponseSuccess("0x0") ... [owise] rule #evm_mine => #mineBlock ~> #rpcResponseSuccess("0x0") ... - [ TIME:String, .JSONs ] - _ => #parseWord( TIME ) + [ TIME:String, .JSONs ] + _ => #parseWord( TIME ) + _ => #parseWord( TIME ) -Int #time() rule #evm_mine => #rpcResponseError(-32000, "Incorrect number of arguments. Method 'evm_mine' requires between 0 and 1 arguments.") ... [ _ , _ , _:JSONs ] @@ -1712,17 +1807,19 @@ Mining rule #firefly_genesisBlock ... [ .JSONs => #unparseQuantity(#time()), .JSONs ] - rule #firefly_genesisBlock => #updateTrieRoots ~> #pushBlockchainState ~> #rpcResponseSuccess(true) ... + rule #firefly_genesisBlock => #updateTrieRoots ~> #pushBlockchainState ~> #incrementBlockNumber ~> #rpcResponseSuccess(true) ... [ TIME:String, .JSONs ] _ => #parseWord( TIME ) _ => #padToWidth( 256, .ByteArray ) _ => 13478047122767188135818125966132228187941283477090363246179690878162135454535 + _ => #parseWord( TIME ) -Int #time() syntax KItem ::= "#mineBlock" // ----------------------------- rule #mineBlock => #finalizeBlock ~> #setParentHash #getBlockByNumber( LATEST, BLOCKLIST, { NETWORK | BLOCK } ) + ~> #makeTxReceipts ~> #updateTrieRoots ~> #saveState ~> #startBlock @@ -1744,7 +1841,7 @@ Mining | "#updateTransactionsRoot" | "#updateReceiptsRoot" // -------------------------------------- - rule #saveState => #incrementBlockNumber ~> #pushBlockchainState ... + rule #saveState => #pushBlockchainState ~> #incrementBlockNumber ... rule #incrementBlockNumber => . ... BN => BN +Int 1 @@ -1777,7 +1874,8 @@ Mining syntax KItem ::= "#updateTimestamp" // ----------------------------------- rule #updateTimestamp => . ... - PREV => #if PREV <=Int #time() #then #time() #else PREV #fi + _ => #time() +Int TIMEDIFF + TIMEDIFF ``` Retrieving logs @@ -1806,7 +1904,7 @@ Retrieving logs [ { PARAMS => "toBlock": "latest", PARAMS } , .JSONs ] requires #getJSON("toBlock", { PARAMS }) ==K undef - rule #eth_getLogs => #getLogs(#parseBlockIdentifier(#getString("fromBlock", { PARAMS })), #parseBlockIdentifier(#getString("toBlock", { PARAMS })), .List) ... + rule #eth_getLogs => #getLogs(#parseBlockIdentifier(#getJSON("fromBlock", { PARAMS })), #parseBlockIdentifier(#getJSON("toBlock", { PARAMS })), .List) ... [ { PARAMS } , .JSONs ] requires #getJSON("fromBlock", { PARAMS }) =/=K undef andBool #getJSON("toBlock" , { PARAMS }) =/=K undef @@ -1896,7 +1994,6 @@ Unimplemented Methods | "#eth_syncing" | "#bzz_hive" | "#bzz_info" - | "#debug_traceTransaction" | "#miner_start" | "#miner_stop" | "#personal_sendTransaction" @@ -1927,7 +2024,6 @@ Unimplemented Methods rule #eth_syncing => #rpcResponseUnimplemented ... rule #bzz_hive => #rpcResponseUnimplemented ... rule #bzz_info => #rpcResponseUnimplemented ... - rule #debug_traceTransaction => #rpcResponseUnimplemented ... rule #miner_start => #rpcResponseUnimplemented ... rule #miner_stop => #rpcResponseUnimplemented ... rule #personal_sendTransaction => #rpcResponseUnimplemented ...